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)
Mtgred's answer above worked wonderfully for me -- I slightly modified it so I could also get the key for the entry. Not as few lines of code, but it gives me the unique key:
class DictModel(db.Model):
def to_dict(self):
tempdict1 = dict([(p, unicode(getattr(self, p))) for p in self.properties()])
tempdict2 = {'key':unicode(self.key())}
tempdict1.update(tempdict2)
return tempdict1