Error in Code example "local flavor"
|Reported by:||bernd||Owned by:||nobody|
|Cc:||dev@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The first Code example don't work.
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()
Change History (6)
comment:1 Changed 7 years ago by Karen Tracey <kmtracey@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 7 years ago by Simon Greenhill
comment:3 Changed 7 years ago by Simon Greenhill
- Has patch set
- Triage Stage changed from Accepted to Ready for checkin