summaryrefslogtreecommitdiff
path: root/docs/ref/class-based-views
diff options
context:
space:
mode:
authorchriscauley <chris@lablackey.com>2014-04-14 14:12:44 -0400
committerTim Graham <timograham@gmail.com>2014-04-16 20:36:29 -0400
commit66ec9ee441618894c1ccebdcdd5eb4d7fbf4a6d3 (patch)
tree956a7d4f6e3b1c348505a3f2d23c7813c6c362b8 /docs/ref/class-based-views
parent030dd4f72ca4d84c0a5e09ee625123d03651fdd1 (diff)
Fixed #22378 -- Updated \d to [0-9]+ in urlpatterns of docs and tests.
Thanks tomwys for the suggestion.
Diffstat (limited to 'docs/ref/class-based-views')
-rw-r--r--docs/ref/class-based-views/base.txt4
-rw-r--r--docs/ref/class-based-views/generic-date-based.txt12
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt
index e8f5271e97..0e43f5b4b3 100644
--- a/docs/ref/class-based-views/base.txt
+++ b/docs/ref/class-based-views/base.txt
@@ -198,8 +198,8 @@ RedirectView
from article.views import ArticleCounterRedirectView, ArticleDetail
urlpatterns = [
- url(r'^counter/(?P<pk>\d+)/$', ArticleCounterRedirectView.as_view(), name='article-counter'),
- url(r'^details/(?P<pk>\d+)/$', ArticleDetail.as_view(), name='article-detail'),
+ url(r'^counter/(?P<pk>[0-9]+)/$', ArticleCounterRedirectView.as_view(), name='article-counter'),
+ url(r'^details/(?P<pk>[0-9]+)/$', ArticleDetail.as_view(), name='article-detail'),
url(r'^go-to-django/$', RedirectView.as_view(url='http://djangoproject.com'), name='go-to-django'),
]
diff --git a/docs/ref/class-based-views/generic-date-based.txt b/docs/ref/class-based-views/generic-date-based.txt
index 9d6d447052..ecaeddfecc 100644
--- a/docs/ref/class-based-views/generic-date-based.txt
+++ b/docs/ref/class-based-views/generic-date-based.txt
@@ -171,7 +171,7 @@ YearArchiveView
from myapp.views import ArticleYearArchiveView
urlpatterns = [
- url(r'^(?P<year>\d{4})/$',
+ url(r'^(?P<year>[0-9]{4})/$',
ArticleYearArchiveView.as_view(),
name="article_year_archive"),
]
@@ -267,11 +267,11 @@ MonthArchiveView
urlpatterns = [
# Example: /2012/aug/
- url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/$',
+ url(r'^(?P<year>[0-9]{4})/(?P<month>[-\w]+)/$',
ArticleMonthArchiveView.as_view(),
name="archive_month"),
# Example: /2012/08/
- url(r'^(?P<year>\d{4})/(?P<month>\d+)/$',
+ url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]+)/$',
ArticleMonthArchiveView.as_view(month_format='%m'),
name="archive_month_numeric"),
]
@@ -361,7 +361,7 @@ WeekArchiveView
urlpatterns = [
# Example: /2012/week/23/
- url(r'^(?P<year>\d{4})/week/(?P<week>\d+)/$',
+ url(r'^(?P<year>[0-9]{4})/week/(?P<week>[0-9]+)/$',
ArticleWeekArchiveView.as_view(),
name="archive_week"),
]
@@ -475,7 +475,7 @@ DayArchiveView
urlpatterns = [
# Example: /2012/nov/10/
- url(r'^(?P<year>\d{4})/(?P<month>[-\w]+)/(?P<day>\d+)/$',
+ url(r'^(?P<year>[0-9]{4})/(?P<month>[-\w]+)/(?P<day>[0-9]+)/$',
ArticleDayArchiveView.as_view(),
name="archive_day"),
]
@@ -597,7 +597,7 @@ DateDetailView
from django.views.generic.dates import DateDetailView
urlpatterns = [
- url(r'^(?P<year>\d+)/(?P<month>[-\w]+)/(?P<day>\d+)/(?P<pk>\d+)/$',
+ url(r'^(?P<year>[0-9]+)/(?P<month>[-\w]+)/(?P<day>[0-9]+)/(?P<pk>[0-9]+)/$',
DateDetailView.as_view(model=Article, date_field="pub_date"),
name="archive_date_detail"),
]