Monday, April 8, 2019

Query multiple dates using filters gte and lte to export data into pdf file

Carrier Report - {{ today | date:"d/m/Y" }}

Name: {{ request.user }}

{% for carrier in carriers %} {% endfor %}
Patient name Promo code Agent name Date submitted to telemed Date telemed returned Date application recorded Date sample recorded Date paid Insurance company name Rejection date Date Submitted to Tamika ins verifier
{{ carrier.patient_name }} {{ carrier.promo_code }} {{ carrier.agent }} {{ carrier.date_submitted_to_telemed }} {{ carrier.date_telemed_returned }} {{ carrier.date_app_rec }} {{ carrier.date_sample_rec }} {{ carrier.date_paid }} {{ carrier.insurance_company }} {{ carrier.rejection_date }} {{ carrier.submitted_to_tamika_ins_verifier }}
Hi, everyone this is my first time posting in this group.

I've hit a deadend in my use case for almost a week now to export a pdf file based on a query for from date(gte) and to date(lte). Below is my code for exporting a pdf file based on the logged in user. I've attached my pdf.html

class PdfCarrier(View):

def get(self, request):
user = self.request.user
carriers = Carrier.objects.filter(agent__name=user)
today = timezone.now()
params = {
'today': today,
'carriers': carriers,
'request': request
}
return Render.render('carrier/carrier_print.html', params)

How can I do it when searching multiple queries especially based on dates(gte and lte) from an another html which will have the search html attribute(s).

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b6543c8a-25d4-4bd6-858a-0153bd030f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment