summaryrefslogtreecommitdiff
path: root/docs/tutorial04.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-20 05:00:52 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-20 05:00:52 +0000
commitc49f2d21ea055ae3c9b66cfd62a9f527a2f6d3b5 (patch)
tree66a8709e51ae865b2a115a5f3753f2460d9b281c /docs/tutorial04.txt
parent0ae4e102dc60de49d8f1457373458082f6639086 (diff)
newforms-admin: Merged to [5983]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial04.txt')
-rw-r--r--docs/tutorial04.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/tutorial04.txt b/docs/tutorial04.txt
index 553a76e9b1..bd16fa2924 100644
--- a/docs/tutorial04.txt
+++ b/docs/tutorial04.txt
@@ -193,7 +193,7 @@ Change it like so::
urlpatterns = patterns('',
(r'^$', 'django.views.generic.list_detail.object_list', info_dict),
(r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict),
- (r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'), 'poll_results'),
+ url(r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'), 'poll_results'),
(r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
)
@@ -209,11 +209,14 @@ objects" and "display a detail page for a particular type of object."
from the URL to be called ``"object_id"``, so we've changed ``poll_id`` to
``object_id`` for the generic views.
- * We've added a name, ``poll_results``, to the results view so that we have
- a way to refer to its URL later on (see `naming URL patterns`_ for more on
- named patterns).
-
+ * We've added a name, ``poll_results``, to the results view so that we
+ have a way to refer to its URL later on (see the documentation about
+ `naming URL patterns`_ for information). We're also using the `url()`_
+ function from ``django.conf.urls.defaults`` here. It's a good habit to
+ use ``url()`` when you are providing a pattern name like this.
+
.. _naming URL patterns: ../url_dispatch/#naming-url-patterns
+.. _url(): ../url_dispatch/#url
By default, the ``object_detail`` generic view uses a template called
``<app name>/<model name>_detail.html``. In our case, it'll use the template