It was a conditional statement, albeit a seemingly poorly constructed one. "If you had a million records you were trying to filter..."
Would you not just replace "annotate" with "filter" and use the same DurationField() expression? Nevertheless, in my case, I would use the annotation for a report that shows counts based on certain criteria. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Melvyn Sopacua Sent: Monday, May 14, 2018 4:32 PM To: [email protected] Subject: Re: SQL select statements to Django ORM On maandag 14 mei 2018 16:42:49 CEST Matthew Pava wrote: > But if in your use case, you had a million records in which you were > trying to filter Full stop right there. No one is filtering anything in the original use case, so you're comparing apples and oranges. Filtering you would do in the database, but you'd still not use annotate, cause you can simply filter on the dob using standard __gte/__lte etc. lookups. -- Melvyn Sopacua -- 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 [email protected]. To post to this group, send email to [email protected]. 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/1618227.LY2WuIfJ59%40fritzbook. For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. 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/0d81237ad6374038b583366bf3394dfb%40ISS1.ISS.LOCAL. For more options, visit https://groups.google.com/d/optout.

