# HG changeset patch # User Aurelien Campeas # Date 1231780514 -3600 # Node ID cf577e26f924ba4c0bb7e37354596bf6a577e634 # Parent 4e23b542f8ad6f3c29974dd06fb4725a63998e8e don't introduce a spurious 'x' key in the entity-as dict diff -r 4e23b542f8ad -r cf577e26f924 common/entity.py --- a/common/entity.py Mon Jan 12 11:00:17 2009 +0100 +++ b/common/entity.py Mon Jan 12 18:15:14 2009 +0100 @@ -957,11 +957,12 @@ relations = [] for key in kwargs: relations.append('X %s %%(%s)s' % (key, key)) + # update current local object + self.update(kwargs) + # and now update the database kwargs['x'] = self.eid self.req.execute('SET %s WHERE X eid %%(x)s' % ','.join(relations), kwargs, 'x') - for key, val in kwargs.iteritems(): - self[key] = val def delete(self): assert self.has_eid(), self.eid