From 076020bd84036ec37da398797bbff1088aae65b7 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 23 Mar 2011 08:03:56 +0100 Subject: [PATCH] add connection to get_db_prep_save --- ox/django/fields.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ox/django/fields.py b/ox/django/fields.py index d958397..e40240e 100644 --- a/ox/django/fields.py +++ b/ox/django/fields.py @@ -49,11 +49,11 @@ class DictField(models.TextField): assert isinstance(value, dict) return value - def get_db_prep_save(self, value): + def get_db_prep_save(self, value, connection): """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) + return super(DictField, self).get_db_prep_save(value, connection) class TupleField(models.TextField): """TupleField is a textfield that contains JSON-serialized tuples.""" @@ -73,11 +73,11 @@ class TupleField(models.TextField): assert isinstance(value, list) return tuple(value) - def get_db_prep_save(self, value): + def get_db_prep_save(self, value, connection): """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) + return super(TupleField, self).get_db_prep_save(value, connection) try: from south.modelsinspector import add_introspection_rules