sous-chef icon indicating copy to clipboard operation
sous-chef copied to clipboard

CAPhoneNumberField: RemovedInLocalflavor20Warning

Open lingxiaoyang opened this issue 8 years ago • 2 comments

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

lingxiaoyang avatar Jan 20 '17 15:01 lingxiaoyang

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.

lingxiaoyang avatar Mar 02 '17 21:03 lingxiaoyang

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.

dgabrielson avatar Dec 05 '17 17:12 dgabrielson