Opened 9 years ago

Closed 9 years ago

#2429 closed defect (invalid)

[patch] Error in Tutorial 4

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

Description

A sentence "So let's create a vote() function in mysite/polls/views.py:" is followed by a code block.
It seems there should be also
from django.core.exceptions import ObjectDoesNotExist

and the line
except (KeyError, Choice.DoesNotExist):
should be replaced with
except (KeyError, ObjectDoesNotExist):

Python 2.4.3
Django svn version 3439

I'm sorry if I'm mistaken

Attachments (1)

tutorial4.diff (566 bytes) - added by anonymous 9 years ago.
Correction in the example code

Download all attachments as: .zip

Change History (4)

comment:1 Changed 9 years ago by anonymous

The only required change is: the line

except (KeyError?, Choice.DoesNotExist?): 

should be replaced with

except (KeyError?, p.DoesNotExist?): 

Changed 9 years ago by anonymous

Correction in the example code

comment:2 Changed 9 years ago by anonymous

  • Summary changed from Error in Tutorial 4 to [patch] Error in Tutorial 4

comment:3 Changed 9 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

The example in the tutorial is correct.

Note: See TracTickets for help on using tickets.
Back to Top