Opened 4 years ago

Closed 4 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 Changed 4 years ago by ptone

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

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