Django

Code

Ticket #4409 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Tutorial part 4

Reported by: rBoa <mitch.hunt.007@gmail.com> Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: tutorial
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

4409.patch (1.7 kB) - added by SmileyChris on 05/28/07 19:32:56.

Change History

05/28/07 18:06:11 changed by Ramiro Morales < >

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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.

05/28/07 19:12:57 changed by SmileyChris

  • version changed from 0.96 to SVN.
  • stage changed from Unreviewed to Accepted.

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

05/28/07 19:32:56 changed by SmileyChris

  • attachment 4409.patch added.

05/28/07 19:39:20 changed by SmileyChris

  • has_patch set to 1.
  • 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.

05/28/07 20:30:25 changed by anonymous

  • needs_better_patch set to 1.

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.

06/01/07 04:33:49 changed 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.

06/01/07 04:35:29 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4409 (Tutorial part 4)




Change Properties
Action