sous-chef
sous-chef copied to clipboard
CAPhoneNumberField: RemovedInLocalflavor20Warning
Expected Behaviour
According to django-localflavor changelog, phone number fields are deprecated in favor of django-phonenumber-field (see this issue). They will be removed at version 2.0.
Thus it implies accordingly a fix in our code before the next update of Python dependencies.
Actual Behaviour
lxyang@lxyang:~/sous-chef$ grep -r "localflavor" -A 2
--
src/member/formsfield.py:from localflavor.ca.forms import (
src/member/formsfield.py- CAPhoneNumberField, CAPostalCodeField
src/member/formsfield.py-)
--
src/member/forms.py:from localflavor.ca.forms import (
src/member/forms.py- CAPhoneNumberField, CAPostalCodeField
src/member/forms.py-)
--
Steps to reproduce
N/A
Let's keep what we have for now. The suggested replacement django-phonenumber-field, although it uses the more common libphonenumber developed by Google (used on Android), doesn't clearly restrict the country. Unless needed, it's better for us to wait for a better replacement package.
Just getting up to speed with this deprecation. I for one would be perfectly happy to migrate my code base (and data) from CAPhoneNumberField to the django-phonenumber-field package if there was adequate documentation. Maybe I'm just missing something, but my first pass at this did not go well.
At a minimum, I'd like to see how to use django-phonenumber-field as a direct replacement for CAPhoneNumberField (or any other country supported by django-localflavor). Documentation for using django-phonenumber-field to support existing data is also lacking (all my db phone numbers are stored in the CA format). In my use case I'd absolutely love to support both CA format AND international format, but it's totally not obvious to me how to do so.
I'd be happy to contribute some documentation if someone could supply me with pointers on how to get this done.