#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext import db import simplejson class JSONProperty(db.Property): def get_value_for_datastore(self, model_instance): return db.Text(simplejson.dumps(getattr(model_instance, self.name))) def make_value_from_datastore(self, value): return simplejson.loads(value) def datastore_type(self): return db.Text class Ent(db.Expando): # class Ent(db.Model): # Replace with this to make it work fine json = JSONProperty(default={}) def main(): the_ent = Ent() the_ent.json['value'] = 0 for ent in Ent.all(): the_ent = ent the_ent.json['value'] += 1 the_ent.put() print the_ent.json['value'] if __name__ == '__main__': main()