From 66ec9ee441618894c1ccebdcdd5eb4d7fbf4a6d3 Mon Sep 17 00:00:00 2001 From: chriscauley Date: Mon, 14 Apr 2014 14:12:44 -0400 Subject: Fixed #22378 -- Updated \d to [0-9]+ in urlpatterns of docs and tests. Thanks tomwys for the suggestion. --- docs/ref/models/instances.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/ref/models') diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 2a93996d8d..9bc7b841c7 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -642,7 +642,7 @@ template tag and a high-level wrapper for the An example should make it clear how to use ``permalink()``. Suppose your URLconf contains a line such as:: - (r'^people/(\d+)/$', 'people.views.details'), + (r'^people/([0-9]+)/$', 'people.views.details'), ...your model could have a :meth:`~django.db.models.Model.get_absolute_url` method that looked like this:: @@ -655,7 +655,7 @@ method that looked like this:: Similarly, if you had a URLconf entry that looked like:: - (r'/archive/(?P\d{4})/(?P\d{2})/(?P\d{2})/$', archive_view) + (r'/archive/(?P[0-9]{4})/(?P[0-9]{2})/(?P[0-9]{2})/$', archive_view) ...you could reference this using ``permalink()`` as follows:: @@ -684,7 +684,7 @@ pattern tuple by a call to the ``url`` function):: from django.conf.urls import url - url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'), + url(r'^people/([0-9]+)/$', 'blog_views.generic_detail', name='people_view'), ...and then using that name to perform the reverse URL resolution instead of the view name:: -- cgit v1.3