Opened 17 years ago
Closed 17 years ago
#4410 closed (duplicate)
Clarification needed with the generic views in Tutorial 4
Reported by: | 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 |
Description
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/urls.py 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 by , 17 years ago
comment:2 by , 17 years ago
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 by , 17 years ago
Everything worked before I start to use generic view. After modifying polls/urls.py, 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 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I'm going to close as a dupe of #4615 which clarifies what needs to be done after using the generic view.
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. :-)