CHANGELOG.rst
Note: Releases are now tracked using
GitHub releases <https://github.com/django-phonenumber-field/django-phonenumber-field/releases>__.
This document remains for historical purposes.
formfields.PhoneNumberField honor PHONENUMBER_DEFAULT_REGIONPHONENUMBER_DEFAULT_REGION for example phone number in form field errors.Backwards incompatible changes
Backwards incompatible changes
formfields.PhoneNumberField with a region now display national phone
numbers in the national format instead of PHONENUMBER_DEFAULT_FORMAT.
International numbers are displayed in the PHONENUMBER_DEFAULT_FORMAT.formfields.PhoneNumberField translation for invalid data.Backwards incompatible changes
PhoneNumber\ s from PythonBackwards incompatible changes
PhonePrefixSelect with initial passed to the
constructor.Backwards incompatible changes
PhoneNumberPrefixWidget. If you do not install it, an
ImproperlyConfigured exception 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.
ValueError on invalid phone numbers - __str__ and __repr__
updated to report invalid phone numbers correctly if detected.Backwards incompatible changes
PhoneNumberField can now be deferred with QuerySet.defer().ValueError.PhoneNumberField.region now uses
PHONENUMBER_DEFAULT_REGION if not specified.Added the region keyword argument to PhoneNumberField.
Fix representation of invalid phone numbers in the database, previously
stored as +NoneNone. Now, invalid phone numbers are represented as:
default_ when it is specified, orstr if the field is blank_ and not null_, orExisting database records can be upgraded with a data migration_.
Added support for Django 2.2.
Tests are now included in the sdist package.
modelfields.PhoneNumberField now inherits from models.CharField
instead of models.Field.
.. _default: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.default .. _blank: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.blank .. _null: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.null .. _data migration: https://docs.djangoproject.com/en/dev/topics/migrations/#data-migrations
null=Truenull=TruePhoneNumberInternationalFallbackWidgetPHONENUMER_DEFAULT_REGION setting with typo