mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #18217 -- Time zone support in generic views
Introduced a distinct implementation depending on the type of the date field (DateField or DateTimeField), and applied appropriate conversions is the latter case, when time zone support is enabled.
This commit is contained in:
@@ -108,6 +108,8 @@ urlpatterns = patterns('',
|
||||
views.BookArchive.as_view(queryset=None)),
|
||||
(r'^dates/books/paginated/$',
|
||||
views.BookArchive.as_view(paginate_by=10)),
|
||||
(r'^dates/booksignings/$',
|
||||
views.BookSigningArchive.as_view()),
|
||||
|
||||
# ListView
|
||||
(r'^list/dict/$',
|
||||
@@ -156,6 +158,8 @@ urlpatterns = patterns('',
|
||||
views.BookYearArchive.as_view(make_object_list=True, paginate_by=30)),
|
||||
(r'^dates/books/no_year/$',
|
||||
views.BookYearArchive.as_view()),
|
||||
(r'^dates/booksignings/(?P<year>\d{4})/$',
|
||||
views.BookSigningYearArchive.as_view()),
|
||||
|
||||
# MonthArchiveView
|
||||
(r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/$',
|
||||
@@ -170,6 +174,8 @@ urlpatterns = patterns('',
|
||||
views.BookMonthArchive.as_view(paginate_by=30)),
|
||||
(r'^dates/books/(?P<year>\d{4})/no_month/$',
|
||||
views.BookMonthArchive.as_view()),
|
||||
(r'^dates/booksignings/(?P<year>\d{4})/(?P<month>[a-z]{3})/$',
|
||||
views.BookSigningMonthArchive.as_view()),
|
||||
|
||||
# WeekArchiveView
|
||||
(r'^dates/books/(?P<year>\d{4})/week/(?P<week>\d{1,2})/$',
|
||||
@@ -184,6 +190,8 @@ urlpatterns = patterns('',
|
||||
views.BookWeekArchive.as_view()),
|
||||
(r'^dates/books/(?P<year>\d{4})/week/(?P<week>\d{1,2})/monday/$',
|
||||
views.BookWeekArchive.as_view(week_format='%W')),
|
||||
(r'^dates/booksignings/(?P<year>\d{4})/week/(?P<week>\d{1,2})/$',
|
||||
views.BookSigningWeekArchive.as_view()),
|
||||
|
||||
# DayArchiveView
|
||||
(r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/$',
|
||||
@@ -198,12 +206,16 @@ urlpatterns = patterns('',
|
||||
views.BookDayArchive.as_view(paginate_by=True)),
|
||||
(r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/no_day/$',
|
||||
views.BookDayArchive.as_view()),
|
||||
(r'^dates/booksignings/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/$',
|
||||
views.BookSigningDayArchive.as_view()),
|
||||
|
||||
# TodayArchiveView
|
||||
(r'dates/books/today/$',
|
||||
(r'^dates/books/today/$',
|
||||
views.BookTodayArchive.as_view()),
|
||||
(r'dates/books/today/allow_empty/$',
|
||||
(r'^dates/books/today/allow_empty/$',
|
||||
views.BookTodayArchive.as_view(allow_empty=True)),
|
||||
(r'^dates/booksignings/today/$',
|
||||
views.BookSigningTodayArchive.as_view()),
|
||||
|
||||
# DateDetailView
|
||||
(r'^dates/books/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/(?P<pk>\d+)/$',
|
||||
@@ -221,6 +233,9 @@ urlpatterns = patterns('',
|
||||
(r'^dates/books/get_object_custom_queryset/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/(?P<pk>\d+)/$',
|
||||
views.BookDetailGetObjectCustomQueryset.as_view()),
|
||||
|
||||
(r'^dates/booksignings/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/(?P<pk>\d+)/$',
|
||||
views.BookSigningDetail.as_view()),
|
||||
|
||||
# Useful for testing redirects
|
||||
(r'^accounts/login/$', 'django.contrib.auth.views.login')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user