[repo] set entity.rset & co when needed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 14 Sep 2009 10:15:11 +0200
branchstable
changeset 3196 77936fa67ae6
parent 3194 650637d4d764
child 3197 b27d19c0db1c
[repo] set entity.rset & co when needed
server/session.py
--- a/server/session.py	Fri Sep 11 20:37:30 2009 +0200
+++ b/server/session.py	Mon Sep 14 10:15:11 2009 +0200
@@ -152,8 +152,12 @@
             if not isinstance(rset.description, list): # else description not set
                 rset.description = list(rset.description)
             rset.description.append([self.describe(targeteid)[0]])
+            targetentity = self.entity_from_eid(targeteid)
+            if targetentity.rset is None:
+                targetentity.rset = rset
+                targetentity.row = rset.rowcount
+                targetentity.col = 0
             rset.rowcount += 1
-            targetentity = self.entity_from_eid(targeteid)
             entities.append(targetentity)
 
     def _update_entity_rel_cache_del(self, eid, rtype, role, targeteid):