mark session.entity method as obsolete stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sat, 27 Jun 2009 00:59:36 +0200
branchstable
changeset 2182 488099333160
parent 2180 bf2e81fb52be
child 2190 d9f5fd1879fc
child 2191 1f0fde12e35b
child 2279 b4e970513117
mark session.entity method as obsolete
server/session.py
--- a/server/session.py	Sat Jun 27 00:37:42 2009 +0200
+++ b/server/session.py	Sat Jun 27 00:59:36 2009 +0200
@@ -84,10 +84,6 @@
         """return an entity class for the given entity type"""
         return self.vreg.etype_class(etype)
 
-    def entity(self, eid):
-        """return a result set for the given eid"""
-        return self.eid_rset(eid).get_entity(0, 0)
-
     def system_sql(self, sql, args=None):
         """return a sql cursor on the system database"""
         if not sql.split(None, 1)[0].upper() == 'SELECT':
@@ -359,16 +355,6 @@
             self._threaddata.transaction_data = {}
             return self._threaddata.transaction_data
 
-    @obsolete('use direct access to session.transaction_data')
-    def query_data(self, key, default=None, setdefault=False, pop=False):
-        if setdefault:
-            assert not pop
-            return self.transaction_data.setdefault(key, default)
-        if pop:
-            return self.transaction_data.pop(key, default)
-        else:
-            return self.transaction_data.get(key, default)
-
     @property
     def pending_operations(self):
         try:
@@ -457,6 +443,21 @@
             description.append(tuple(row_descr))
         return description
 
+    @obsolete('use direct access to session.transaction_data')
+    def query_data(self, key, default=None, setdefault=False, pop=False):
+        if setdefault:
+            assert not pop
+            return self.transaction_data.setdefault(key, default)
+        if pop:
+            return self.transaction_data.pop(key, default)
+        else:
+            return self.transaction_data.get(key, default)
+
+    @obsolete('use entity_from_eid(eid, etype=None)')
+    def entity(self, eid):
+        """return a result set for the given eid"""
+        return self.eid_rset(eid).get_entity(0, 0)
+
 
 class ChildSession(Session):
     """child (or internal) session are used to hijack the security system