The title may have been confusing, but please let me explain:
Currently when I am storing phone number with raw digits like 5554441234
. Then in my template I was going to "format" the number into something like 555-444-1234
.
I realized in Django's localflavor
, there is a US phone number field that checks if a string is in XXX-XXX-XXXX
format.
So my question is should I enter the phone number as raw digits then format it in the template or should I enter the phone number in the formatted way using localflavor?
If I choose the latter, would the XXX-XXX-XXXX
format restriction apply even to the database API
level or in the Django admin page?
CharField
to enforce theXXX-XXX-XXXX
validation on amodels.py
level? – Prayerful