Updated url dispatch docs to make it more clear that the prefix need not end in a dot
git-svn-id: http://code.djangoproject.com/svn/django/trunk@282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
df6feb54f2
commit
96d69c5b5f
|
@ -21,7 +21,6 @@ Here's the example from that overview::
|
|||
urlpatterns = patterns('',
|
||||
(r'^/articles/(?P<year>\d{4})/$', 'myproject.news.views.articles.year_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'myproject.news.views.articles.month_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'myproject.news.views.articles.month_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'myproject.news.views.articles.article_detail'),
|
||||
)
|
||||
|
||||
|
@ -33,10 +32,15 @@ above example could be written more concisely as::
|
|||
urlpatterns = patterns('myproject.news.views.articles',
|
||||
(r'^/articles/(?P<year>\d{4})/$', 'year_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'month_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/$', 'month_archive'),
|
||||
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'article_detail'),
|
||||
)
|
||||
|
||||
.. admonition:: Note
|
||||
|
||||
More precisely, the actual view function use is ``prefix + "." +
|
||||
function_name``; that is, the trailing "dot" does not need to be put in the
|
||||
prefix. Django: saving you time, one keystroke at a time.
|
||||
|
||||
Including other URLconfs
|
||||
========================
|
||||
|
||||
|
|
Loading…
Reference in New Issue