From b9e972b96171236c40a8a922c62d36b49854ee52 Mon Sep 17 00:00:00 2001 From: Alasdair Nicol Date: Fri, 24 Apr 2015 11:13:51 +0100 Subject: [PATCH] Fixed #24695 -- Tidied up a couple of regexes in the CBV docs Thanks datakid for the report --- docs/ref/class-based-views/generic-date-based.txt | 2 +- docs/ref/class-based-views/generic-display.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ref/class-based-views/generic-date-based.txt b/docs/ref/class-based-views/generic-date-based.txt index 08d8a9e866..81b42e0982 100644 --- a/docs/ref/class-based-views/generic-date-based.txt +++ b/docs/ref/class-based-views/generic-date-based.txt @@ -593,7 +593,7 @@ DateDetailView from django.views.generic.dates import DateDetailView urlpatterns = [ - url(r'^(?P[0-9]+)/(?P[-\w]+)/(?P[0-9]+)/(?P[0-9]+)/$', + url(r'^(?P[0-9]{4})/(?P[-\w]+)/(?P[0-9]+)/(?P[0-9]+)/$', DateDetailView.as_view(model=Article, date_field="pub_date"), name="archive_date_detail"), ] diff --git a/docs/ref/class-based-views/generic-display.txt b/docs/ref/class-based-views/generic-display.txt index 1ca8125501..5dc0391319 100644 --- a/docs/ref/class-based-views/generic-display.txt +++ b/docs/ref/class-based-views/generic-display.txt @@ -59,7 +59,7 @@ DetailView from article.views import ArticleDetailView urlpatterns = [ - url(r'^(?P[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), + url(r'^(?P[-\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), ] **Example myapp/article_detail.html**: