nevermind, i figured it out. .extra(where=['EXTRACT (HOUR FROM datetime) = 0'])
add that to the queryset. Works in Postgres, don't know about the others On Feb 2, 10:47 pm, HARRY POTTRER <cp368...@ohio.edu> wrote: > I have a table that has a bunch of rows, each with a datetime field. > These rows are created every three hours (midnight, 03:00, 06:00, > 09:00, etc). I want to filter the queryset to only grab the objects > where the datetime field is midnight. Is there an easy way to do this? > Something like: > > Model.objects.filter(datetime__hour="00:00") > > or something, but that actually works... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.