Opened 17 years ago

Closed 17 years ago

#4409 closed (fixed)

Tutorial part 4

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

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 Chris Beaven 17 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Ramiro Morales < >, 17 years ago

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 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedAccepted
Version: 0.96SVN

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

by Chris Beaven, 17 years ago

Attachment: 4409.patch added

comment:3 by Chris Beaven, 17 years ago

Has patch: set
Triage Stage: AcceptedReady 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 by anonymous, 17 years ago

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 by Malcolm Tredinnick, 17 years ago

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 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(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