Additional field or validator types for different kinds of numbers #609
julianwachholz
started this conversation in
Ideas
Replies: 1 comment
-
I think the validators should be enough, the model and form fields can be configured to use validators following Django patterns.
In case of doubts on the above, the validator should not be trivial. If it is, there is little value in keeping all variations of properties checks from the PhoneNumber object to match all possible use cases. An example of how simple a validator can be: django-phonenumber-field/phonenumber_field/validators.py Lines 8 to 13 in f7765f4 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to propose a potential feature to introduce new field classes and/or ready to use validator functions that could cover uses cases like enforcing a mobile phone number on some fields. (Or landline, toll-free etc.)
These identifiers exist upstream and the Django library could provide readily available model and form fields as well as validator functions.
One caveat I already know of is that the type of number cannot be determined by the number alone in all regions, so allowing unknown type would have to be configurable.
Beta Was this translation helpful? Give feedback.
All reactions