Ticket #1682: htmlFixes.diff

File htmlFixes.diff, 1.2 KB (added by scum, 18 years ago)

Tutorial 4 'add .html' fixes

  • tutorial04.txt

     
    175175    urlpatterns = patterns('',
    176176        (r'^$', 'django.views.generic.list_detail.object_list', info_dict),
    177177        (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict),
    178         (r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results')),
     178        (r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html')),
    179179        (r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
    180180    )
    181181
     
    203203
    204204Because we have more than one entry in the URLconf that uses ``object_detail``
    205205for the polls app, we manually specify a template name for the results view:
    206 ``template_name='polls/results'``. Otherwise, both views would use the same
     206``template_name='polls/results.html'``. Otherwise, both views would use the same
    207207template. Note that we use ``dict()`` to return an altered dictionary in place.
    208208
    209209In previous versions of the tutorial, the templates have been provided with a context
Back to Top