[dbapi] provide get_option_value over DBAPIRequest (closes #2515522) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 14 Nov 2012 11:06:24 +0100
branchstable
changeset 8585 3f60f416dddb
parent 8584 f89fe2496146
child 8586 bc74608d2003
[dbapi] provide get_option_value over DBAPIRequest (closes #2515522)
dbapi.py
req.py
server/session.py
--- a/dbapi.py	Wed Oct 24 14:38:05 2012 +0200
+++ b/dbapi.py	Wed Nov 14 11:06:24 2012 +0100
@@ -308,6 +308,9 @@
     def from_controller(self):
         return 'view'
 
+    def get_option_value(self, option, foreid=None):
+        return self.cnx.get_option_value(option, foreid)
+
     def set_session(self, session, user=None):
         """method called by the session handler when the user is authenticated
         or an anonymous connection is open
--- a/req.py	Wed Oct 24 14:38:05 2012 +0200
+++ b/req.py	Wed Nov 14 11:06:24 2012 +0100
@@ -75,6 +75,9 @@
         self.local_perm_cache = {}
         self._ = unicode
 
+    def get_option_value(self, option, foreid=None):
+        raise NotImplementedError
+
     def property_value(self, key):
         """return value of the property with the given key, giving priority to
         user specific value if any, else using site value
--- a/server/session.py	Wed Oct 24 14:38:05 2012 +0200
+++ b/server/session.py	Wed Nov 14 11:06:24 2012 +0100
@@ -302,6 +302,8 @@
             self.set_tx_data()
             return self.__threaddata.txdata
 
+    def get_option_value(self, option, foreid=None):
+        return self.repo.get_option_value(option, foreid)
 
     def hijack_user(self, user):
         """return a fake request/session using specified user"""