diff options
| author | chriscauley <chris@lablackey.com> | 2014-04-14 14:12:44 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-04-16 20:36:29 -0400 |
| commit | 66ec9ee441618894c1ccebdcdd5eb4d7fbf4a6d3 (patch) | |
| tree | 956a7d4f6e3b1c348505a3f2d23c7813c6c362b8 /docs/topics/class-based-views | |
| parent | 030dd4f72ca4d84c0a5e09ee625123d03651fdd1 (diff) | |
Fixed #22378 -- Updated \d to [0-9]+ in urlpatterns of docs and tests.
Thanks tomwys for the suggestion.
Diffstat (limited to 'docs/topics/class-based-views')
| -rw-r--r-- | docs/topics/class-based-views/generic-display.txt | 2 | ||||
| -rw-r--r-- | docs/topics/class-based-views/generic-editing.txt | 4 | ||||
| -rw-r--r-- | docs/topics/class-based-views/mixins.txt | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/class-based-views/generic-display.txt b/docs/topics/class-based-views/generic-display.txt index 98d2b79d32..54b75ce557 100644 --- a/docs/topics/class-based-views/generic-display.txt +++ b/docs/topics/class-based-views/generic-display.txt @@ -401,7 +401,7 @@ custom view:: urlpatterns = [ #... - url(r'^authors/(?P<pk>\d+)/$', AuthorDetailView.as_view(), name='author-detail'), + url(r'^authors/(?P<pk>[0-9]+)/$', AuthorDetailView.as_view(), name='author-detail'), ] Then we'd write our new view -- ``get_object`` is the method that retrieves the diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt index 2587c9426d..74d19d53b1 100644 --- a/docs/topics/class-based-views/generic-editing.txt +++ b/docs/topics/class-based-views/generic-editing.txt @@ -147,8 +147,8 @@ Finally, we hook these new views into the URLconf:: urlpatterns = [ # ... url(r'author/add/$', AuthorCreate.as_view(), name='author_add'), - url(r'author/(?P<pk>\d+)/$', AuthorUpdate.as_view(), name='author_update'), - url(r'author/(?P<pk>\d+)/delete/$', AuthorDelete.as_view(), name='author_delete'), + url(r'author/(?P<pk>[0-9]+)/$', AuthorUpdate.as_view(), name='author_update'), + url(r'author/(?P<pk>[0-9]+)/delete/$', AuthorDelete.as_view(), name='author_delete'), ] .. note:: diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt index 00729f36f9..40ba615088 100644 --- a/docs/topics/class-based-views/mixins.txt +++ b/docs/topics/class-based-views/mixins.txt @@ -261,7 +261,7 @@ We can hook this into our URLs easily enough:: urlpatterns = [ #... - url(r'^author/(?P<pk>\d+)/interest/$', RecordInterest.as_view(), name='author-interest'), + url(r'^author/(?P<pk>[0-9]+)/interest/$', RecordInterest.as_view(), name='author-interest'), ] Note the ``pk`` named group, which |
