json field in DAL, thanks Alan

This commit is contained in:
mdipierro
2013-01-08 09:23:18 -06:00
parent 2da5b2191f
commit ec21e81f19
5 changed files with 412 additions and 282 deletions
+4
View File
@@ -20,6 +20,10 @@ except ImportError:
import contrib.simplejson as json_parser # fallback to pure-Python module
def loads_json(o):
# deserialize a json string
return json_parser.loads(o)
def custom_json(o):
if hasattr(o, 'custom_json') and callable(o.custom_json):
return o.custom_json()