rset.py
changeset 2648 4ae7d02ce063
parent 2647 b0a2e779845c
child 2650 18aec79ec3a3
--- a/rset.py	Sun Aug 02 12:00:17 2009 +0200
+++ b/rset.py	Mon Aug 03 09:24:08 2009 +0200
@@ -370,7 +370,15 @@
         # XXX should we consider updating a cached entity with possible
         #     new attributes found in this resultset ?
         try:
-            return req.entity_cache(eid)
+            entity = req.entity_cache(eid)
+            if entity.rset is None:
+                # entity has no rset set, this means entity has been cached by
+                # the repository (req is a repository session) which had no rset
+                # info. Add id.
+                entity.rset = self
+                entity.row = row
+                entity.col = col
+            return entity
         except KeyError:
             pass
         # build entity instance