views:

540

answers:

1

There are several filter methods for dates (year,month,day). If I want to match a full date, say 2008/10/18, is there a better way than this:

Entry.objects.filter(pub_date__year=2008).filter(pub_date__month=10).filter(pub_date__day=18)
+9  A: 

How about using a datetime object. For example:

from datetime import datetime
Entry.objects.filter(pub_date=datetime(2008, 10, 18))
Zach Hirsch