Changeset 5946
- Timestamp:
- 08/19/07 10:08:48 (1 year ago)
- Files:
-
- django/trunk/docs/tutorial04.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial04.txt
r5801 r5946 194 194 (r'^$', 'django.views.generic.list_detail.object_list', info_dict), 195 195 (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict), 196 (r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'), 'poll_results'),196 url(r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html'), 'poll_results'), 197 197 (r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'), 198 198 ) … … 210 210 ``object_id`` for the generic views. 211 211 212 * We've added a name, ``poll_results``, to the results view so that we have 213 a way to refer to its URL later on (see `naming URL patterns`_ for more on 214 named patterns). 215 212 * We've added a name, ``poll_results``, to the results view so that we 213 have a way to refer to its URL later on (see the documentation about 214 `naming URL patterns`_ for information). We're also using the `url()`_ 215 function from ``django.conf.urls.defaults`` here. It's a good habit to 216 use ``url()`` when you are providing a pattern name like this. 217 216 218 .. _naming URL patterns: ../url_dispatch/#naming-url-patterns 219 .. _url(): ../url_dispatch/#url 217 220 218 221 By default, the ``object_detail`` generic view uses a template called
