merge
authorsylvain.thenault@logilab.fr
Tue, 13 Jan 2009 17:58:58 +0100
changeset 398 cc16ee7d2d86
parent 396 76d593bd4221 (current diff)
parent 397 cf577e26f924 (diff)
child 399 8df3b190275b
child 403 ffc7dc7d2218
merge
--- a/common/entity.py	Tue Jan 13 17:58:42 2009 +0100
+++ b/common/entity.py	Tue Jan 13 17:58:58 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