#27618: docs/intro/tutorial04.txt: Incorrect Information in Amend Views section
-------------------------------------+-------------------------------------
               Reporter:  Karan      |          Owner:  nobody
  Sharma                             |
                   Type:             |         Status:  assigned
  Uncategorized                      |
              Component:             |        Version:  1.10
  Documentation                      |       Keywords:  tutorial,
               Severity:  Normal     |  documentation
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In the tutorial https://docs.djangoproject.com/en/1.10/intro/tutorial04
 /#amend-views, the tutorial says that `no changes needed` for `vote()`

 {{{
 def vote(request, question_id):
     ... # same as above, no changes needed.

 }}}

 Since `question_id` is replaced by `pk`, so this change needs to be done
 in the `vote()` method as well.

 Error Log:


 {{{
 Traceback:

 File "/Users/ninjaPython/Work/django-tutorial/venv/lib/python3.5/site-
 packages/django/core/handlers/exception.py" in inner
   39.             response = get_response(request)

 File "/Users/ninjaPython/Work/django-tutorial/venv/lib/python3.5/site-
 packages/django/core/handlers/base.py" in _get_response
   187.                 response = self.process_exception_by_middleware(e,
 request)

 File "/Users/ninjaPython/Work/django-tutorial/venv/lib/python3.5/site-
 packages/django/core/handlers/base.py" in _get_response
   185.                 response = wrapped_callback(request,
 *callback_args, **callback_kwargs)

 File "/Users/ninjaPython/Work/django-tutorial/myblog/polls/views.py" in
 vote
   26.     question = get_object_or_404(Question,pk=question_id)

 Exception Type: NameError at /polls/1/vote/
 Exception Value: name 'question_id' is not defined

 }}}

 Screenshot:  http://i.imgur.com/m3d7GDA.png

 I'd like to submit a patch for it if the community approves it as a bug.

--
Ticket URL: <https://code.djangoproject.com/ticket/27618>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.2e478107df3cc786d1a0206bcd7c903f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to