Opened 18 years ago

Closed 18 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: no UI/UX: no

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 18 years ago.
Correction in the example code

Download all attachments as: .zip

Change History (4)

comment:1 by anonymous, 18 years ago

The only required change is: the line

except (KeyError?, Choice.DoesNotExist?): 

should be replaced with

except (KeyError?, p.DoesNotExist?): 

by anonymous, 18 years ago

Attachment: tutorial4.diff added

Correction in the example code

comment:2 by anonymous, 18 years ago

Summary: Error in Tutorial 4[patch] Error in Tutorial 4

comment:3 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

The example in the tutorial is correct.

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