Opened 16 years ago
Closed 16 years ago
#10940 closed (invalid)
Omission in tutorial, part 4: generic views
Reported by: | zpearce | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | tutorial, generic view, object_id | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When refactoring the poll app for generic views, no mention is made of the need to change one of the parameters passed into the vote() view from poll_id to object_id.
Original:
def vote(request, poll_id):
...snip...
Should be:
def vote(request, object_id):
...etc...
Note:
See TracTickets
for help on using tickets.
This is not necessary since
vote
is not a generic view. Notice that the URLconf keeps the poll_id variable:(r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote')