Django Comparison Filtering

I have a django model with the Reminder_End_Date = models.DateField() field. I have to filter out all the model entries that have a reminder date longer than today's date.

However, when I try to use the following statement, it does not work:

 now=datetime.date.today() reminderlist=Reminder.objects.filter(Reminder_End_Date>now ) 

Can anyone tell how to do this? thanks in advance

+4
source share
1 answer

This is the basic syntax of a Django request. See documentation for query execution .

 reminderlist = Reminder.objects.filter(Reminder_End_Date__gt=now ) 
+7
source

All Articles