Newer Djangos spit out Deprecation Warnings #3

Closed
aquarion opened this Issue Mar 5, 2011 · 5 comments

Comments

Projects
None yet
3 participants

aquarion commented Mar 5, 2011

[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)

@ghost

ghost commented Apr 19, 2011

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 commented May 12, 2011

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

@ghost

ghost commented May 16, 2011

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)

Collaborator

bradjasper commented Sep 27, 2011

This was resolved by a recent commit.

@bradjasper bradjasper closed this Sep 27, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment