[session] simplify mode property
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 27 Mar 2013 11:42:13 +0100
changeset 8811 1b7b4709c0cf
parent 8810 1a25bdd49f9a
child 8812 52af67a2f0a5
[session] simplify mode property We can delegate very thing to transaction utility
server/session.py
--- a/server/session.py	Wed Mar 27 11:01:40 2013 +0100
+++ b/server/session.py	Wed Mar 27 11:42:13 2013 +0100
@@ -1031,14 +1031,7 @@
         else: # mode == 'write'
             self.default_mode = 'read'
 
-    def get_mode(self):
-        return self._tx.mode
-    def set_mode(self, value):
-        self._tx.mode = value
-    mode = property(get_mode, set_mode,
-                    doc='transaction mode (read/write/transaction), resetted to'
-                    ' default_mode on commit / rollback')
-
+    mode = tx_attr('mode', writable=True)
     commit_state = tx_attr('commit_state', writable=True)
 
     @property