Opened 12 years ago

Closed 12 years ago

#4410 closed (duplicate)

Clarification needed with the generic views in Tutorial 4

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


I am working my way through the tutorials and have a confusing section in Tutorial 4: Use generic views: Less code is better

I have read this section several times and I think it is missing some steps. The confusion starts right after we change the polls/ file. I have the poll_list.html and poll_detail.html views working, but the results will not display.

I would be happy to help try fixing the section. Certainly, if I can be made to understand then it could be viewed as complete. ;)

Change History (4)

comment:1 Changed 12 years ago by Malcolm Tredinnick

It's unclear if this is a request for help (in which case you should ask on the django-users mailing list) or just an offer to try and clarify some things. In the latter case, you don't need permission -- just attach a patch for us to review. We can't say yes or no without something to read. :-)

comment:2 Changed 12 years ago by Collin Grady <cgrady@…>

This may have something to do with the use of reverse() - I've helped several users in IRC get past this point, all with identical errors.

When the tutorial has you convert to generic views, it neglects to have you update reverse() - in addition, even if you did update it, it would reverse the wrong view since two of them use the same generic - it should be using url() for the results view so that it can be reversed directly.

In rBoa's case, it may be that he did see he had to update the reverse(), but it's reversing the wrong view now, so after a POST it just takes him right back to the page he was on.

comment:3 Changed 12 years ago by deerchao@…

Everything worked before I start to use generic view. After modifying polls/, I can't get any polls in /polls/, and any choices in /polls/1/(and yes, it's not a 404, but /polls/5/ gets a 404).
I'm using PostgreSql 8.2, django 0.96.

comment:4 Changed 12 years ago by Chris Beaven

Resolution: duplicate
Status: newclosed

I'm going to close as a dupe of #4615 which clarifies what needs to be done after using the generic view.

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