diff options
| author | Sjoerd Job Postmus <sjoerdjob@sjec.nl> | 2016-10-20 19:29:04 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-20 18:04:42 -0400 |
| commit | df41b5a05d4e00e80e73afe629072e37873e767a (patch) | |
| tree | baaf71ae695e2d3af604ea0d663284cb406c71e4 /docs/topics/class-based-views/generic-editing.txt | |
| parent | c4c128d67c7dc2830631c6859a204c9d259f1fb1 (diff) | |
Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201.
Thanks Aymeric Augustin for shepherding the DEP and patch review.
Thanks Marten Kenbeek and Tim Graham for contributing to the code.
Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.
Diffstat (limited to 'docs/topics/class-based-views/generic-editing.txt')
| -rw-r--r-- | docs/topics/class-based-views/generic-editing.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt index 3fde51253a..69f2158021 100644 --- a/docs/topics/class-based-views/generic-editing.txt +++ b/docs/topics/class-based-views/generic-editing.txt @@ -149,14 +149,14 @@ Finally, we hook these new views into the URLconf: .. snippet:: :filename: urls.py - from django.conf.urls import url + from django.urls import path from myapp.views import AuthorCreate, AuthorUpdate, AuthorDelete urlpatterns = [ # ... - url(r'author/add/$', AuthorCreate.as_view(), name='author-add'), - 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'), + path('author/add/', AuthorCreate.as_view(), name='author-add'), + path('author/<int:pk>/', AuthorUpdate.as_view(), name='author-update'), + path('author/<int:pk>/delete/', AuthorDelete.as_view(), name='author-delete'), ] .. note:: |
