req.py
changeset 5302 dfd147de06b2
parent 5201 2b4267157f85
parent 5290 15846058378b
child 5423 e15abfdcce38
equal deleted inserted replaced
5298:66b0987716f9 5302:dfd147de06b2
    41 class RequestSessionBase(object):
    41 class RequestSessionBase(object):
    42     """base class containing stuff shared by server session and web request
    42     """base class containing stuff shared by server session and web request
    43 
    43 
    44     request/session is the main resources accessor, mainly through it's vreg
    44     request/session is the main resources accessor, mainly through it's vreg
    45     attribute:
    45     attribute:
    46     :vreg:
    46 
    47       the instance's registry
    47     :attribute vreg: the instance's registry
    48     :vreg.schema:
    48     :attribute vreg.schema: the instance's schema
    49       the instance's schema
    49     :attribute vreg.config: the instance's configuration
    50     :vreg.config:
       
    51       the instance's configuration
       
    52     """
    50     """
    53     def __init__(self, vreg):
    51     def __init__(self, vreg):
    54         self.vreg = vreg
    52         self.vreg = vreg
    55         try:
    53         try:
    56             encoding = vreg.property_value('ui.encoding')
    54             encoding = vreg.property_value('ui.encoding')
   138         first = rql.split(' ', 1)[0].lower()
   136         first = rql.split(' ', 1)[0].lower()
   139         if first in ('insert', 'set', 'delete'):
   137         if first in ('insert', 'set', 'delete'):
   140             raise Unauthorized(self._('only select queries are authorized'))
   138             raise Unauthorized(self._('only select queries are authorized'))
   141 
   139 
   142     def get_cache(self, cachename):
   140     def get_cache(self, cachename):
   143         """
   141         """cachename should be dotted names as in :
   144         NOTE: cachename should be dotted names as in :
   142 
   145         - cubicweb.mycache
   143         - cubicweb.mycache
   146         - cubes.blog.mycache
   144         - cubes.blog.mycache
   147         - etc.
   145         - etc.
   148         """
   146         """
   149         if cachename in CACHE_REGISTRY:
   147         if cachename in CACHE_REGISTRY: