connection has to be named argument

This commit is contained in:
j 2011-03-24 20:53:22 +01:00
parent 076020bd84
commit d35a1c721c

View file

@ -53,7 +53,7 @@ class DictField(models.TextField):
"""Convert our JSON object to a string before we save"""
assert isinstance(value, dict)
value = json.dumps(value, default=to_json)
return super(DictField, self).get_db_prep_save(value, connection)
return super(DictField, self).get_db_prep_save(value, connection=connection)
class TupleField(models.TextField):
"""TupleField is a textfield that contains JSON-serialized tuples."""
@ -77,7 +77,7 @@ class TupleField(models.TextField):
"""Convert our JSON object to a string before we save"""
assert isinstance(value, tuple)
value = json.dumps(value, default=to_json)
return super(TupleField, self).get_db_prep_save(value, connection)
return super(TupleField, self).get_db_prep_save(value, connection=connection)
try:
from south.modelsinspector import add_introspection_rules