Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Newer Djangos spit out Deprecation Warnings #3

Closed
aquarion opened this Issue · 5 comments

4 participants

@aquarion

[virtialenv]/src/django/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_save method hasn't been updated to take a connection argument.
new_class = super(SubfieldBase, cls).new(cls, name, bases, attrs)
[virtialenv]/src/django/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_lookup method hasn't been updated to take connection and prepared arguments.
new_class = super(SubfieldBase, cls).new(cls, name, bases, attrs)

@tercerojista

Is there an easy solution to this? I'm using the code as is, and the line:

return super(JSONField, self).get_db_prep_save(value)

is causing the warning. I expected that simply changing it to:

return super(JSONField, self).get_db_prep_save(value, connection)

would solve the issue, but this actually breaks the code!

@diox

This is fixed in a fork: chrisglass/django-jsonfield@4d780d3

@diox

Correction, this wasn't the right file (for some reason there are leftover .py files at the root of the app ??) See liberation@3d94305 , it's untested however (this app needs unit tests!)

@tercerojista

I found the answer I was looking for elsewhere (http://dev.merengueproject.org/changeset/4108)

The line I was looking for was:

return super(JSONField, self).get_db_prep_save(value, connection=connection)

@bradjasper
Owner

This was resolved by a recent commit.

@bradjasper bradjasper closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.