Skip to content

Commit

Permalink
fixed NoSQL Json, thanks Alan
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Mar 25, 2013
1 parent 30ea9ac commit b152110
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 2.4.5-stable+timestamp.2013.03.21.15.09.50
Version 2.4.5-stable+timestamp.2013.03.25.15.24.28
15 changes: 8 additions & 7 deletions gluon/dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4364,13 +4364,14 @@ def represent(self, obj, fieldtype):
elif fieldtype == 'blob':
pass
elif fieldtype == 'json':
obj = self.to_unicode(obj)
if have_serializers:
obj = serializers.loads_json(obj)
elif simplejson:
obj = simplejson.loads(obj)
else:
raise RuntimeError("missing simplejson")
if isinstance(obj, basestring):
obj = self.to_unicode(obj)
if have_serializers:
obj = serializers.loads_json(obj)
elif simplejson:
obj = simplejson.loads(obj)
else:
raise RuntimeError("missing simplejson")
elif is_string and field_is_type('list:string'):
return map(self.to_unicode,obj)
elif is_list:
Expand Down

0 comments on commit b152110

Please sign in to comment.