Code

Opened 6 years ago

Closed 6 years ago

#7253 closed (wontfix)

typo on http://www.djangoproject.com/documentation/tutorial04/ ?

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

Description

Hello,

I got this error when following until tutorial04 :
=========================================
TypeError at /polls/1/vote/
vote() got an unexpected keyword argument 'poll_id'
...
=========================================

And finally point to this:
=========================================
Change it like so:

...
urlpatterns = patterns(,
...

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

)
=========================================

and after the <poll_id> into <object_id>
the error has disappeared.
So I think that should be a typo or mistyped.
Please ignore if it was not.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by Simon Greenhill

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

I think what's happened is that you skipped the step changing the hand-written views into generic views (i.e. around line 199 we introduce generic views (which require <object_id>)).

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.