[bw compat] json_request setter is necessary for some cubes which has json_request (eg preview)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 09 Jan 2012 22:40:43 +0100
changeset 8155 c075950cc929
parent 8151 8e3fa37cd8aa
child 8156 f47252e24354
[bw compat] json_request setter is necessary for some cubes which has json_request (eg preview)
web/request.py
--- a/web/request.py	Mon Jan 09 22:40:07 2012 +0100
+++ b/web/request.py	Mon Jan 09 22:40:43 2012 +0100
@@ -121,11 +121,15 @@
             self.html_headers.define_var('pageid', pid, override=False)
         self.pageid = pid
 
-    @property
-    def json_request(self):
+    def _get_json_request(self):
         warn('[3.15] self._cw.json_request is deprecated, use self._cw.ajax_request instead',
              DeprecationWarning, stacklevel=2)
         return self.ajax_request
+    def _set_json_request(self, value):
+        warn('[3.15] self._cw.json_request is deprecated, use self._cw.ajax_request instead',
+             DeprecationWarning, stacklevel=2)
+        self.ajax_request = value
+    json_request = property(_get_json_request, _set_json_request)
 
     @property
     def authmode(self):