#1295 closed defect (fixed)
slug typo in generic views docs
Reported by: | matt | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Since slugify is now generating slugs with dashes instead of underscores, the documentation should be updated to accept dashed slugs. In the generic views docs, the follwing:
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), )
should read:
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), )
This might appear other places in the docs and should be cleaned up accordingly.
Note:
See TracTickets
for help on using tickets.
(In [2319]) Fixed #1295 -- Fixed typo in generic views docs. Thanks, Matt