VeryApt / django-phone-field

Lightweight model and form field for phone numbers in Django
GNU General Public License v3.0
52 stars 13 forks source link

Remove context parameter from `from_db_value` due to RemovedInDjango30Warning #4

Closed kblicharski closed 6 years ago

kblicharski commented 6 years ago

This is a pretty small change -- when using your package in one of my projects, I noticed this deprecation warning and took it upon myself to take care of it. Let me know if it'd be feasible to merge this in.

va-andrew commented 6 years ago

Thanks for contributing! I'll merge in your changes for .gitignore and removing the last parameter from from_db_value(). As for the deprecation warnings, which version of Django are you using, and what do the warnings say? I'm not getting any warnings on my test system (Django 2.0).

kblicharski commented 6 years ago

https://docs.djangoproject.com/en/2.0/releases/2.0/#features-deprecated-in-2-0

I discovered this while running Django 2.1, but I just tested version 2.0 and the deprecation warnings seem to still arise.

/Users/kblicharski/.virtualenvs/django-phone-field-KclDqfEZ/lib/python3.6/site-packages/django/db/models/sql/compiler.py:992: RemovedInDjango30Warning: Remove the context parameter from PhoneField.from_db_value(). Support for it will be removed in Django 3.0.
  RemovedInDjango30Warning,
va-andrew commented 6 years ago

Ah I see them now, wasn't running with the -Wd flag. And that's why you added the manage.py change. Merging