Thanks guys!
On Wed, Dec 14, 2016 at 9:47 PM, Michal Petrucha <michal.petrucha@koniiiik.org> wrote:
On Wed, Dec 14, 2016 at 09:36:06PM +0200, Sithembewena Lloyd Dube wrote:
> Hi,
>
> Has anyone captured phone number information using a Form/ModelForm
> instance? I have the field as an IntegerField in my model and (for obvious
> reasons) it truncates the leading '0'. How have you solved this problem,
> anyone?
Easy – don't use integer input fields for phone numbers, use input
fields for short text strings with appropriate validation.
For example, you might want to look at some of the phone number fields
implemented in https://django-localflavor.readthedocs.io/en/latest/ ,
and take some inspiration from them.
Cheers,
Michal
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ .20161214194702.GK22986% 40koniiiik.org
For more options, visit https://groups.google.com/d/optout .
Regards,
Sithembewena
Sithembewena
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH-SnCDAtBib3a8DpJX%3D9LF2u7eHVav%3D_vpdHgJ_YS-Hts4QcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment