Comments (3)
The value is just so hight to definitely be large enough for all phone numbers. And didn't see a performance impact in just setting it at this size. I guess something like 32 would have been enough as well.
Annoyingly this is not easy to change in hindsight. If we just change the value here, people using this field in re-usable apps will produce different database migrations based on which version of django-phonenumber-field they happen to have had installed when they created their migration. So it is likely that people will get warnings about missing migrations in a re-usable app (which they don't have control over), if they upgrade django-phonenumber-field in their project.
IMHO there is no significant performance reason to go through that hassle for this change. But I'm no database expert, so I may be wrong :-)
from django-phonenumber-field.
You are right, it don't have penalty on performance because CharField
use varchar
in MySQL and PostgreSQL at least and so use only necessary bytes, I agree that isn't needed to change the field size, but a comment on code or docs about the size would be nice (maybe that issue will work as documentation too). Anyway I was more curious about why use that size :D.
Thx for reply and btw, good job u have done in this fields 👍 .
from django-phonenumber-field.
instead something like 20 (1 for +, 3 for country code, 3 for area code, 13 for phone digits).
You're missing extensions to phone numbers in there (;ext=123
) and also that some people use formats other than E164 for the database.
from django-phonenumber-field.
Related Issues (20)
- Support typing HOT 7
- Remove check for .mo files
- Form field does not auto-detect region from international number HOT 2
- Italian translations incomplete HOT 5
- Usage with django ninja HOT 5
- Multiple countrycodes in `PhoneNumberField` HOT 3
- Make the model/formfield region kwarg the default selection in PhoneNumberPrefixWidget HOT 1
- Validation error with wrong locale HOT 1
- bug in python 3.10 HOT 1
- Extension information is lost during serialization HOT 8
- [Question] Best way to generae US phonenumber for testing HOT 1
- validate_international_phonenumber does not validate correctly at some cases HOT 1
- Pydantic Serialization HOT 1
- Use Django's "normal" validation, not hardcoded in __init__() HOT 9
- Turkmenistan phone numbers has been updated HOT 1
- The valid phonenumber is not accepted by this package HOT 1
- 0493 prefix invalid numbet Australia HOT 1
- Handling of special (non-geo) phone numbers
- python-phonenumbers should be a requirement HOT 1
- django-phonenumber-field[phonenumberslite] requires phonenumbers on migration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-phonenumber-field.