Re: Filter by date range

2022-09-09 Thread Muhammad Juwaini Abdul Rahman
What's your value of 'fromdate' and 'todate'? On Sat, 10 Sept 2022 at 13:27, tech george wrote: > Hello Carlos, > > I have used the code below as you advised by when I filter the table comes > blank: > > query_results = Prescription.objects.filter(date__range=[fromdate,todate]) > > Regards, > >

Re: Filter by date range

2022-09-09 Thread tech george
Hello Carlos, I have used the code below as you advised by when I filter the table comes blank: query_results = Prescription.objects.filter(date__range=[fromdate,todate]) Regards, On Fri, Sep 9, 2022 at 6:11 PM carlos wrote: > Hello why use raw? > query_results = Prescription.objects.filter(

Re: Filter by date range

2022-09-09 Thread carlos
Hello why use raw? query_results = Prescription.objects.filter(date__range=[fromdate,todate]) if you have any problem with performance hit database use select_related or used m2m field use prefect_related https://docs.djangoproject.com/en/4.1/ref/models/querysets/ best! On Fri, Sep 9, 2022 at 7:4

Filter by date range

2022-09-09 Thread tech george
Hello friends! I am trying to give users an easier way to filter data by date range. My views.py code is as below, but unfortunately, it is hiding data without applying the filter whenever I try to use if, else statements. Please advise what I might be doing wrong. views.py ef referralsReports

Re: Why are the items not appearing in the table?

2022-09-09 Thread Matheus Bon
The error looked like this. But for what I was wanting I had to leave this class method and go to the def method... That way I can do a lot more customization, like putting the update view in a popup. But I managed to solve it, thank you very much Boris! Em qui., 8 de set. de 2022 às 20:23, Boris