Note: Releases are now tracked using GitHub releases. This document remains for historical purposes.
- Make
formfields.PhoneNumberFieldhonorPHONENUMBER_DEFAULT_REGION - Use
PHONENUMBER_DEFAULT_REGIONfor example phone number in form field errors. - Add support for Django 4.0
- Add Persian (farsi) translations.
- Update uk_AR translations
Backwards incompatible changes
- Drop support for Python 3.6
- Add support for Python 3.10
- Update Czech, Dutch and pt_BR translations
Backwards incompatible changes
formfields.PhoneNumberFieldwith aregionnow display national phone numbers in the national format instead ofPHONENUMBER_DEFAULT_FORMAT. International numbers are displayed in thePHONENUMBER_DEFAULT_FORMAT.
- Lazy load
formfields.PhoneNumberFieldtranslation forinvaliddata. - Update Russian translations
Backwards incompatible changes
- Drop support for end-of-life Django 3.0
- Allow sorting
PhoneNumbers from Python - Add support for Python 3.9 and Django 3.2
- Add Argentinian, Bulgarian, Indonesian, Ukrainian translations
- Update Esperanto and European Spanish translations
Backwards incompatible changes
- Drop support for Python 3.5
- Add support for Django 3.1.
- Fix rendering
PhonePrefixSelectwithinitialpassed to the constructor. - The Babel dependency is now optional.
- Switched to setuptools declarative configuration for packaging and installation.
- Add Arabic and Russian translation.
- Correct License information in package metadata.
Backwards incompatible changes
- Drop support for end-of-life Django 1.11 and 2.1.
- As the Babel dependency is now optional, you must now install it to use
PhoneNumberPrefixWidget. If you do not install it, anImproperlyConfiguredexception will be raised when instantiated.
The big version bump is due to the change in how invalid phone numbers are handled.
Starting with 2.4.0 we added very aggressive validation, which raised ValueError
for invalid numbers. This caused problems in unexpected places (like when filtering a
queryset). Starting with 4.0.0 we acknowledge that we can not completely prevent
invalid numbers from entering the system. Changes directly to the database, validation
changes in the upstream phonenumbers library, changes in the django settings may all
lead to invalid numbers in the database. Now it is possible to save an invalid number
to the database and __str__ and __repr__ clearly indicate invalid numbers.
- Don’t raise
ValueErroron invalid phone numbers -__str__and__repr__updated to report invalid phone numbers correctly if detected. - Various translation updates
- Allow overriding the default invalid phone number message.
- Update French and Hebrew translations.
- Add a valid phone number example to invalid phone number error messages.
Backwards incompatible changes
- Drop support for Django 2.0.
- Drop support for Python 2.7 and 3.4.
- A
PhoneNumberFieldcan now be deferred withQuerySet.defer(). - Saving or filtering by an invalid phone number will now raise a
ValueError. - The model field attribute
PhoneNumberField.regionnow usesPHONENUMBER_DEFAULT_REGIONif not specified.
- Fixed a regression to re-allow the model field to override the default form field.
Added the
regionkeyword argument toPhoneNumberField.Fix representation of invalid phone numbers in the database, previously stored as
+NoneNone. Now, invalid phone numbers are represented as:Existing database records can be upgraded with a data migration.
Added support for Django 2.2.
Tests are now included in the sdist package.
modelfields.PhoneNumberFieldnow inherits frommodels.CharFieldinstead ofmodels.Field.
- Added support for
null=True
- Removed hardcoded dependency to phonenumbers library. Now developers have to manually install either phonenumbers or phonenumberslite.
- Added Romanian locale
- Added Bangla locale
- Update French locale
- Update Italian locale
- Statically depend on phonenumbers Previously the phonenumberslight dependency was used dynamically in setup.py if it already was installed, causing problems with building wheels and with pipenv.
- Added Ukrainian locale
- Added Simplified Chinese locale
- Add Django 2.0 support
- Drop Support for Django<1.11
- Translations: Swedish
- Add rest_framework Serializer
- Hashable phonenumber object
- Various bugfixes and improvements
- Django 1.10 support
- Bugfixes and cleanup
- Translations: Brazilian Portuguese, Spanish, Norwegian, Dutch, Azerbaijani, Turkish and French
- Django 1.9 support
- README updated and links fixed
- support for HTML5.0 tel input type added
- locale files are now included
- new translations: Danish, Esperanto, Polish, all translations reformatted, Russian translation expanded
- PhoneNumberField.get_prep_value changed to enable setting
null=True - new widget added:
PhoneNumberInternationalFallbackWidget - new backward compatible requirement phonenumberslite instead of phonenumbers
- lots of tests
- dropped support for
PHONENUMER_DEFAULT_REGIONsetting with typo