I\'ve been searching for quite a while with no success. My project isn\'t using Django, is there a simple way to serialize App Engine models (google.appengine.ext.db.Model)
For simple cases, I like the approach advocated here at the end of the article:
# after obtaining a list of entities in some way, e.g.:
user = users.get_current_user().email().lower();
col = models.Entity.gql('WHERE user=:1',user).fetch(300, 0)
# ...you can make a json serialization of name/key pairs as follows:
json = simplejson.dumps(col, default=lambda o: {o.name :str(o.key())})
The article also contains, at the other end of the spectrum, a complex serializer class that enriches django's (and does require _meta
-- not sure why you're getting errors about _meta missing, perhaps the bug described here) with the ability to serialize computed properties / methods. Most of the time you serialization needs lay somewhere in between, and for those an introspective approach such as @David Wilson's may be preferable.