web/request.py
changeset 8128 0a927fe4541b
parent 8082 1c37783ff610
child 8155 c075950cc929
equal deleted inserted replaced
8125:7070250bf50d 8128:0a927fe4541b
    80 
    80 
    81 
    81 
    82 
    82 
    83 class CubicWebRequestBase(DBAPIRequest):
    83 class CubicWebRequestBase(DBAPIRequest):
    84     """abstract HTTP request, should be extended according to the HTTP backend"""
    84     """abstract HTTP request, should be extended according to the HTTP backend"""
    85     json_request = False # to be set to True by json controllers
    85     ajax_request = False # to be set to True by ajax controllers
    86 
    86 
    87     def __init__(self, vreg, https, form=None):
    87     def __init__(self, vreg, https, form=None):
    88         super(CubicWebRequestBase, self).__init__(vreg)
    88         super(CubicWebRequestBase, self).__init__(vreg)
    89         self.https = https
    89         self.https = https
    90         if https:
    90         if https:
   118         pid = self.form.get('pageid')
   118         pid = self.form.get('pageid')
   119         if pid is None:
   119         if pid is None:
   120             pid = make_uid(id(self))
   120             pid = make_uid(id(self))
   121             self.html_headers.define_var('pageid', pid, override=False)
   121             self.html_headers.define_var('pageid', pid, override=False)
   122         self.pageid = pid
   122         self.pageid = pid
       
   123 
       
   124     @property
       
   125     def json_request(self):
       
   126         warn('[3.15] self._cw.json_request is deprecated, use self._cw.ajax_request instead',
       
   127              DeprecationWarning, stacklevel=2)
       
   128         return self.ajax_request
   123 
   129 
   124     @property
   130     @property
   125     def authmode(self):
   131     def authmode(self):
   126         return self.vreg.config['auth-mode']
   132         return self.vreg.config['auth-mode']
   127 
   133