Re: fintering a queryset based on time

2010-02-02 Thread HARRY POTTRER
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 wrote: > I have a table that has a bunch of rows, each with a datetime field. > These rows are created every

fintering a queryset based on time

2010-02-02 Thread HARRY POTTRER
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.ob