Hi!
I wrote a ticket about time zone warnings in date-based generic views:
https://code.djangoproject.com/ticket/18217
After some research, I understand that there are more problems with this views, than I thought at first. django.views.generic.dates module uses aware and naive datetime objects together, which breaks all date-based views except YearArchiveView.
Let's have, for example:
- America/Chicago as TIME_ZONE
- an article, published at 2012-12-31 23:00:00 in local time zone (2012-01-01 05:00:00 UTC)
- an url /articles/{year}/ which returns list of articles for requested year
- an url /articles/{year}/{month}/ which returns list of articles for requested month
As I understand, year and month must be in UTC in urls, or date_list from all date-based generic views is useless, because it contains dates in UTC.
So, our article must be in /articles/2012/ and in /articles/2012/01/. But it won't be in /articles/2012/01/, because MonthArchiveView will use datetime.date objects, which will be treated as naive datetime.datetime object by ORM, and local time zone will be used.
The same thing is true for DayArchiveView, TodayArchiveView and DateDetailView.
This issue affects trunk and 1.4 versions of Django.
--
Mike Yumatov