defrex/django-encrypted-fields

Use Field.from_db_value instead of SubfieldBase to be compatible with Django 2.0

mberth opened this issue · 5 comments

With Django 1.8 I get this deprecation warning:

django/db/models/fields/subclassing.py:22: RemovedInDjango20Warning: 
    SubfieldBase has been deprecated. Use Field.from_db_value instead.

See Custom model fields in the Django 1.8 docs.

i got the same warning too

With Django 1.9.1 I get this. It refers to Django 1.10 instead of 2.0:

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:31: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedFieldMixin(object):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:200: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedCharField(EncryptedFieldMixin, models.CharField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:204: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedTextField(EncryptedFieldMixin, models.TextField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:208: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedDateTimeField(EncryptedFieldMixin, models.DateTimeField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:212: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedIntegerField(EncryptedFieldMixin, models.IntegerField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:216: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedFloatField(EncryptedFieldMixin, models.FloatField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:220: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedEmailField(EncryptedFieldMixin, models.EmailField):

/Users/[redacted]/.virtualenvs/[redacted]/lib/python2.7/site-packages/encrypted_fields/fields.py:223: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.
  class EncryptedBooleanField(EncryptedFieldMixin, models.BooleanField):

I've submitted Pull Request #14 to fix this.

have you upload the package to the pypi?

thanks