[server/session] ensure appobject obtained from the session are linked to the session
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 25 Jun 2013 14:04:46 +0200
changeset 9084 e8e4dfc97670
parent 9083 fe254c803ed1
child 9085 af6085c9ac69
[server/session] ensure appobject obtained from the session are linked to the session
server/session.py
--- a/server/session.py	Tue Jun 25 12:25:52 2013 +0200
+++ b/server/session.py	Tue Jun 25 14:04:46 2013 +0200
@@ -919,7 +919,10 @@
 
     This is to be used by session"""
     def meth_from_cnx(session, *args, **kwargs):
-        return getattr(session._cnx, meth_name)(*args, **kwargs)
+        result = getattr(session._cnx, meth_name)(*args, **kwargs)
+        if getattr(result, '_cw', None) is not None:
+            result._cw = session
+        return result
     return meth_from_cnx
 
 class Timestamp(object):