mirror of
https://github.com/scrapy/scrapy.git
synced 2025-03-01 03:34:50 +00:00
16 lines
627 B
Python
16 lines
627 B
Python
|
from django.conf.urls.defaults import *
|
||
|
from models import Entry # relative import
|
||
|
|
||
|
info_dict = {
|
||
|
'queryset': Entry.objects.all(),
|
||
|
'date_field': 'pub_date',
|
||
|
}
|
||
|
|
||
|
urlpatterns = patterns('django.views.generic.date_based',
|
||
|
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[\w-]+)/$', 'object_detail', dict(info_dict, slug_field='slug')),
|
||
|
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict),
|
||
|
(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),
|
||
|
(r'^(?P<year>\d{4})/$', 'archive_year', info_dict),
|
||
|
(r'^/?$', 'archive_index', info_dict),
|
||
|
)
|