From 94a0b1aec598ca167525bb849d920f278abea9d3 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 12 Sep 2014 20:17:49 -0500 Subject: [PATCH] fixed json field representation --- gluon/dal.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gluon/dal.py b/gluon/dal.py index 5981eb39..f9d0f653 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2037,13 +2037,13 @@ class BaseAdapter(ConnectionPool): else: obj = str(obj) elif fieldtype == 'json': - if not self.native_json: - if have_serializers: - obj = serializers.json(obj) - elif simplejson: - obj = simplejson.dumps(obj) - else: - raise RuntimeError("missing simplejson") + # always pass a string JSON string + if have_serializers: + obj = serializers.json(obj) + elif simplejson: + obj = simplejson.dumps(obj) + else: + raise RuntimeError("missing simplejson") if not isinstance(obj, bytes): obj = bytes(obj) try: