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)
Change History (6)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 16 years ago
comment:3 by , 16 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Here's one way of solving it.
comment:4 by , 16 years ago
Cc: | added |
---|
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.