Re: Querying for objects created on a certain date

2009-10-12 Thread aa56280
Karen, I'm aware that my 30-days-ago version of the query is current time/ date specific. Good catch :-) Thanks for the solution. I also found this one: today = datetime.datetime.today() Document.objects.filter(created_on__month=today.month, created_on__day=today.day, created_on__year=today.year

Re: Querying for objects created on a certain date

2009-10-12 Thread Karen Tracey
On Mon, Oct 12, 2009 at 6:00 PM, phoebebright wrote: > > Try this: > > from datetime import date > > today = date.today() > > todays_stuff = Stuff.objects.filter(created_on = today) > > Looking at the SQL that generates for a model that contains a DateTimeField, not a DateField, I don't believe th

Re: Querying for objects created on a certain date

2009-10-12 Thread phoebebright
Try this: from datetime import date today = date.today() todays_stuff = Stuff.objects.filter(created_on = today) On Oct 12, 10:07 pm, aa56280 wrote: > I have a DateTimeField called "created_on" on a model called > "Documents". It serves as a timestamp for when the record was added. > > I'm

Re: Querying for objects created on a certain date

2009-10-12 Thread Karen Tracey
On Mon, Oct 12, 2009 at 5:07 PM, aa56280 wrote: > > I have a DateTimeField called "created_on" on a model called > "Documents". It serves as a timestamp for when the record was added. > > I'm trying to write a query that will return all Documents created_on > a particular date, say today. I can m

Querying for objects created on a certain date

2009-10-12 Thread aa56280
I have a DateTimeField called "created_on" on a model called "Documents". It serves as a timestamp for when the record was added. I'm trying to write a query that will return all Documents created_on a particular date, say today. I can make it work if I look for a record within a range of dates..