added custom represent to GoogleDatastoreAdapter, thanks Alan

This commit is contained in:
mdipierro
2014-09-14 11:58:16 -05:00
parent b991f2926f
commit ce897b3569
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.9.9-stable+timestamp.2014.09.13.18.54.57
Version 2.9.9-stable+timestamp.2014.09.14.11.58.10
+11
View File
@@ -5053,6 +5053,17 @@ class GoogleDatastoreAdapter(NoSQLAdapter):
def parse_id(self, value, field_type):
return value
def represent(self, obj, fieldtype):
if fieldtype == "json":
if have_serializers:
return serializers.json(obj)
elif simplejson:
return simplejson.dumps(obj)
else:
raise Exception("Could not dump json object (missing json library)")
else:
return NoSQLAdapter.represent(self, obj, fieldtype)
def create_table(self, table, migrate=True, fake_migrate=False, polymodel=None):
myfields = {}
for field in table: