Opened 18 years ago
Closed 18 years ago
#4409 closed (fixed)
Tutorial part 4
Reported by: | 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)
Change History (7)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 0.96 → 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
by , 18 years ago
Attachment: | 4409.patch added |
---|
comment:3 by , 18 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → 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 by , 18 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 , 18 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 , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.