[1.8.x] Fixed #24695 -- Tidied up a couple of regexes in the CBV docs
Thanks datakid for the report
Backport of b9e972b961
from master
This commit is contained in:
parent
fa49b99e31
commit
415a65fc0c
|
@ -593,7 +593,7 @@ DateDetailView
|
|||
from django.views.generic.dates import DateDetailView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^(?P<year>[0-9]+)/(?P<month>[-\w]+)/(?P<day>[0-9]+)/(?P<pk>[0-9]+)/$',
|
||||
url(r'^(?P<year>[0-9]{4})/(?P<month>[-\w]+)/(?P<day>[0-9]+)/(?P<pk>[0-9]+)/$',
|
||||
DateDetailView.as_view(model=Article, date_field="pub_date"),
|
||||
name="archive_date_detail"),
|
||||
]
|
||||
|
|
|
@ -59,7 +59,7 @@ DetailView
|
|||
from article.views import ArticleDetailView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^(?P<slug>[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'),
|
||||
url(r'^(?P<slug>[-\w]+)/$', ArticleDetailView.as_view(), name='article-detail'),
|
||||
]
|
||||
|
||||
**Example myapp/article_detail.html**:
|
||||
|
|
Loading…
Reference in New Issue