Thanks Tom, problem solved! On Monday, 13 January 2014 20:14:51 UTC+5:30, Tom Evans wrote: > > On Sat, Jan 11, 2014 at 4:51 AM, Kush Goyal > <[email protected]<javascript:>> > wrote: > > I am using postgres as my database. I have a model called Invoice with a > > datetime field. I get an error when I run the query: > > > > Invoice.objects.datetimes('date_field','day') > > > > The error is: > > > > AttributeError: 'DateTimeQuery' object has no attribute 'tzinfo' > > > > This happens when USE_TZ setting is set to True in my settings file. > > > > I have read the documentation on django docs about datetimes query and > it > > says that when using postgres pytz is not required. But I installed pytz > > anyway and tried again but still got the error. > > > > When I set USE_TZ to false the query runs fine and there are no errors. > > > > I found this ticket on django website which reports this error but I do > not > > know how to use the patch it talks about. > > > > https://code.djangoproject.com/ticket/21432 > > > > Can someone please tell me how to run the query without errors with > > USE_TZ=True. > > Update to django 1.6.1 or later, when this bug was fixed. > > Cheers > > Tom >
-- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2b67b578-e978-4478-9d63-367089681d96%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.

