Opened 8 years ago

Closed 8 years ago

#4409 closed (fixed)

Tutorial part 4

Reported by: rBoa <mitch.hunt.007@…> Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: tutorial
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

In the section covering the 'vote' function, I think there is an error. The line:

reverse('results', args=(p.id,))

I do not think the reverse function is correct and was able to verify within 'shell'. The reverse function should be:

reverse('mysite.polls.views.results', args=(p.id,))

BTW: I am using 0.96-pre

Attachments (1)

4409.patch (1.7 KB) - added by SmileyChris 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Ramiro Morales < >

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I seems you are using the current documentation (http://www.djangoproject.com/documentation/tutorial04/) that is reflects the current SVN trunk status/features. If you are using a 0.96-pre you should be using http://www.djangoproject.com/documentation/0.95/tutorial04/ instead.

There is a "This document is for Django's SVN release, which can be significantly different than previous releases. Get old docs here: 0.96, 0.95" disclaimer at the top of the page with relevant links.

comment:2 Changed 8 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 0.96 to SVN

This is still a valid bug. The urlconf in tutoraial part 3 didn't set up a named view, so you'll need the full view in the reverse function

Changed 8 years ago by SmileyChris

comment:3 Changed 8 years ago by SmileyChris

  • Has patch set
  • Triage Stage changed from Accepted to Ready for checkin

It's probably cleaner to just pass the view function itself in this case, so that's how I updated the docs.

comment:4 Changed 8 years ago by anonymous

  • Patch needs improvement set

The change to passing the function works for the first portion of tutorial part 4 but not for the end when the tutorial has the user delete the results() function to use generic views.

comment:5 Changed 8 years ago by mtredinnick

I've kept the reverse() call using the string form of the name because we are using the string version throughout the tutorial and introducing yet another new concept in this paragraph of the tutorial would be a bit harsh. I've also updated the reverse() documentation to mention both function references and string names.

comment:6 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [5401]) Fixed #4409 -- Fixed a typo in tutorial (thanks, mitch.hunt.007@…
). Also updated the reverse() documentation to reflect that it can take
function references or strings for function names.

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