Opened 16 years ago

Closed 16 years ago

#7685 closed (fixed)

Error in Code example "local flavor"

Reported by: bernd Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: dev@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The first Code example don't work.

http://www.djangoproject.com/documentation/localflavor/

from django import newforms as forms
from django.contrib.localflavor import fr

class MyForm(forms.Form):
    my_french_phone_no = fr.forms.FRPhoneNumberField()

get this error/traceback:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<console>", line 2, in MyForm
AttributeError: 'module' object has no attribute 'forms'

This works for me (changed the import part)

from django import newforms as forms
from django.contrib.localflavor.fr.forms import FRPhoneNumberField

class MyForm(forms.Form):
    my_french_phone_no = FRPhoneNumberField()

Attachments (1)

7685.diff (577 bytes ) - added by Simon Greenhill 16 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Karen Tracey <kmtracey@…>, 16 years ago

Triage Stage: UnreviewedAccepted

This also came up on the mailing list a while ago:

http://groups.google.com/group/django-users/browse_thread/thread/1ff7a6501b4ca41c/d713c213999ec047

but in a quick search I can't find that the poster followed up with opening a ticket.

comment:2 by Karen Tracey <kmtracey@…>, 16 years ago

Also reported in #7749

by Simon Greenhill, 16 years ago

Attachment: 7685.diff added

comment:3 by Simon Greenhill, 16 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

Here's one way of solving it.

comment:4 by Simon Greenhill, 16 years ago

Cc: dev@… added

comment:5 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [7961]) Fixed #7685 -- fixed a typo in French localflavor documentation.

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