# HG changeset patch # User Pierre-Yves David # Date 1363979477 -3600 # Node ID 9b2f6891647439fdddf805de02fbeb8ec58b169d # Parent 9d6a34b9838d4c1de91907b7419e7351b5fe17bb [transaction] rename transaction_data to data Transaction.transaction_data is redundant. A transaction_data property is left for backward compatibility. Deprecation mechanism will come in later changeset diff -r 9d6a34b9838d -r 9b2f68916474 server/session.py --- a/server/session.py Fri Mar 22 19:58:43 2013 +0100 +++ b/server/session.py Fri Mar 22 20:11:17 2013 +0100 @@ -165,7 +165,7 @@ Internal transaction data: - :attr:`transaction_data`,is a dictionary containing some shared data + :attr:`data`,is a dictionary containing some shared data cleared at the end of the transaction. Hooks and operations may put arbitrary data in there, and this may also be used as a communication channel between the client and the repository. @@ -208,7 +208,7 @@ self.cnxset = None #: dict containing arbitrary data cleared at the end of the transaction - self.transaction_data = {} + self.data = {} #: ordered list of operations to be processed on commit/rollback self.pending_operations = [] #: (None, 'precommit', 'postcommit', 'uncommitable') @@ -228,10 +228,14 @@ # RQLRewriter are not thread safe self._rewriter = rewriter + @property + def transaction_data(self): + return self.data + def clear(self): """reset internal data""" - self.transaction_data = {} + self.data = {} #: ordered list of operations to be processed on commit/rollback self.pending_operations = [] #: (None, 'precommit', 'postcommit', 'uncommitable') @@ -451,8 +455,8 @@ tx.pending_operations = self.pending_operations # everything in transaction_data should be copied back but the entity # type cache we don't want to avoid security pb - tx.transaction_data = self.transaction_data.copy() - tx.transaction_data.pop('ecache', None) + tx.data = self.transaction_data.copy() + tx.data.pop('ecache', None) return session def add_relation(self, fromeid, rtype, toeid):