Opened 13 years ago

Closed 13 years ago

#17109 closed Uncategorized (worksforme)

poll_results should be polls_results in final change to views.py on tutorial 4

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Ran through the tutorial and got all the way through to https://docs.djangoproject.com/en/dev/intro/tutorial04/. The last change to views.py for the Polls application on this page shows "return HttpResponseRedirect(reverse('poll_results', args=(p.id,)))" without the double-quotes. I think it should use polls_results in place of poll_results as the latter argument generates a traceback.

Change History (1)

comment:1 by Preston Holmes, 13 years ago

Resolution: worksforme
Status: newclosed

This is the correct name for the view - as it matches the earlier section on changes to the URLConf:

    url(r'^(?P<pk>\d+)/results/$',
        DetailView.as_view(
            model=Poll,
            template_name='polls/results.html'),
        name='poll_results'),
    (r'^(?P<poll_id>\d+)/vote/$', 'polls.views.vote'),

you likely have a typo in that earlier section

Note: See TracTickets for help on using tickets.
Back to Top