Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10294 closed (duplicate)

Tutorial 4 uses incorrect variable

Reported by: nic Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I could also be doing something wrong here, but it looks like a line in the section where you create generic views is incorrect. Here's the current line:

(r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),

It seems to me that the poll_id should have been changed to object_id. I'm brand new to Python (and Django), so I'm not certain that's the complete solution, but it seemed to fix the generic views problems I had. (Also, sorry I didn't attach a patch even though it seems simple to me; very overwhelmed first-timer here.)

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by dc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #7253 and #5300

comment:2 Changed 5 years ago by nic

If this is a duplicate, should the documentation make this more explicit? When you copy over the new views and change the IDs to object-related names for the generic view, you do get the type error described in #7253. Clearer documentation (or perhaps a tarball with the final code for comparison) would do much to help, especially for a beginner's tutorial.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.