[web/request] deprecate user_callback
Storing closures in session data considered harmful. Closes #3567793
--- a/doc/3.19.rst Fri Mar 07 10:27:14 2014 +0100
+++ b/doc/3.19.rst Mon Mar 10 17:54:02 2014 +0100
@@ -143,6 +143,10 @@
a composite relation does not entail any more the deletion of the
component side of the relation.
+* ``_cw.user_callback`` and ``_cw.user_rql_callback`` are deprecated. Users
+ are encouraged to write an actual controller (e.g. using ``ajaxfunc``)
+ instead of storing a closure in the session data.
+
Deprecated Code Drops
----------------------
--- a/web/request.py Fri Mar 07 10:27:14 2014 +0100
+++ b/web/request.py Mon Mar 10 17:54:02 2014 +0100
@@ -416,6 +416,7 @@
req.execute(rql, args, key)
return self.user_callback(rqlexec, rqlargs, *args, **kwargs)
+ @deprecated('[3.19] use a traditional ajaxfunc / controller')
def user_callback(self, cb, cbargs, *args, **kwargs):
"""register the given user callback and return a URL which can
be inserted in an HTML view. When the URL is accessed, the