Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Here is my fix for
http://code.google.com/p/google-app-engine-samples/source/browse/trunk/geochat/j
son.py
http://stackoverflow.com/a/9105898/94363
elif isinstance(obj, db.Model):
properties = obj.properties().items()
output = {}
for field, value in properties:
data = getattr(obj, field)
if isinstance(data, str):
# db.Blob inherits from str
data = data.encode('string-escape')
output[field] = data
output['id'] = obj.key().id()
return output
Original comment by regis.de...@gmail.com
on 2 Feb 2012 at 1:33
Original issue reported on code.google.com by
regis.de...@gmail.com
on 2 Feb 2012 at 1:31