diff -r 9b1b7020d179 -r 848e92bb81cc entity.py --- a/entity.py Fri Apr 16 19:24:53 2010 +0200 +++ b/entity.py Fri Apr 16 19:45:11 2010 +0200 @@ -269,6 +269,14 @@ return '' % ( self.e_schema, self.eid, self.keys(), id(self)) + def __json_encode__(self): + """custom json dumps hook to dump the entity's eid + which is not part of dict structure itself + """ + dumpable = dict(self) + dumpable['eid'] = self.eid + return dumpable + def __nonzero__(self): return True