Ticket #4908: tutorial04.diff

File tutorial04.diff, 1.3 KB (added by James Bennett, 17 years ago)

Patch which fixes and clarifies the usage

  • docs/tutorial04.txt

     
    193193    urlpatterns = patterns('',
    194194        (r'^$', 'django.views.generic.list_detail.object_list', info_dict),
    195195        (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'),
    197197        (r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
    198198    )
    199199
     
    210210      ``object_id`` for the generic views.
    211211
    212212    * 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).
     213      a way to refer to its URL later on. The syntax for this is
     214      slightly different -- see `naming URL patterns`_ for more on
     215      named patterns.
    215216     
    216217.. _naming URL patterns: http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
    217218
Back to Top