Ticket #16218: ticket-16218.diff

File ticket-16218.diff, 1.3 KB (added by nnrcschmdt, 4 years ago)
  • tests/regressiontests/views/generic_urls.py

     
    11# -*- coding:utf-8 -*-
    22from django.conf.urls.defaults import patterns, url
     3from django.views.generic.dates import MonthArchiveView
    34
    45from models import *
    56
     
    4546    (r'^date_based/archive_day/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
    4647        'archive_day',
    4748        numeric_days_info_dict),
     49)
     50# class-based views
     51urlpatterns += patterns('',
    4852    (r'^date_based/archive_month/(?P<year>\d{4})/(?P<month>\d{1,2})/$',
    49         'archive_month',
    50         date_based_info_dict),
     53        MonthArchiveView.as_view(model=Article,
     54                                 date_field='date_created',
     55                                 month_format='%m')),
    5156    (r'^date_based/datefield/archive_month/(?P<year>\d{4})/(?P<month>\d{1,2})/$',
    52         'archive_month',
    53         date_based_datefield_info_dict),
     57        MonthArchiveView.as_view(model=DateArticle,
     58                                 date_field='date_created',
     59                                 month_format='%m')),
    5460)
    5561
    5662# crud generic views.
Back to Top