Commits

Benjamin Wohlwend  committed 05460f0

added *args, **kwargs to `JSONField.get_db_prep_save`

Django 1.2 added the `connection` argument to the `get_db_prep_save`
method signature and, since Django 1.3, issues a `DeprecationWarning`
if subclasses don't accept that argument.

  • Participants
  • Parent commits 421dff6

Comments (0)

Files changed (1)

File annoying/fields.py

             pass
         return value
 
-    def get_db_prep_save(self, value):
+    def get_db_prep_save(self, value, *args, **kwargs):
         if value == "":
             return None
         if isinstance(value, dict):
             value = json.dumps(value, cls=DjangoJSONEncoder)
-        return super(JSONField, self).get_db_prep_save(value)
+        return super(JSONField, self).get_db_prep_save(value, *args, **kwargs)