Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemovedInDjango110Warning: SubfieldBase has been deprecated. #997

Closed
tom-dalton-fanduel opened this issue Aug 19, 2016 · 4 comments
Closed

Comments

@tom-dalton-fanduel
Copy link

Using 0.2.21 with Django 1.9, I get the following deprecation warning:

RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead.

It looks like this was originally a problem and was fixed by #813. However, it looks like recently the warning was reintroduced, by this:

03ae001#diff-25f350079af94bedfb90b3a9e8cafb59R15

@tom-dalton-fanduel
Copy link
Author

tom-dalton-fanduel commented Aug 19, 2016

I wonder if the try/catch:

try:
    from django.db.models import SubfieldBase
    field_class = functools.partial(six.with_metaclass, SubfieldBase)
except ImportError:
    field_class = functools.partial(six.with_metaclass, type)

could be replaced with a version check along the lines of:

# SubfieldBase causes RemovedInDjango110Warning in 1.8 and 1.9, and will not work in 1.10 or later
import django
if django.VERSION[:2] >= (1, 8):
    field_class = functools.partial(six.with_metaclass, type)
else:
    from django.db.models import SubfieldBase
    field_class = functools.partial(six.with_metaclass, SubfieldBase)

@ThibautNicodeme
Copy link

Having the same issue. It doesn't seem to be blocking anything, but it'd be nice if it could be fixed. Especially since it apparently was back in October last year?

@tom-dalton-fanduel
Copy link
Author

tom-dalton-fanduel commented Sep 2, 2016

Created a PR with the proposed fix from above: #1008

@omab
Copy link
Owner

omab commented Dec 13, 2016

The fix for this issue got merged into the social-app-django component.

@omab omab closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants