--- 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