From 537dabb9c31e1d24a851596e5748e50dfe124a8f Mon Sep 17 00:00:00 2001 From: Jeremie Dokime Date: Wed, 14 May 2014 09:52:44 +0200 Subject: [PATCH] Inject restful method for LOAD() Better solution than my last commit for the restful method by inject the real restful method. We can now call LOAD() on a @request.restful() decorated action. --- gluon/compileapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/compileapp.py b/gluon/compileapp.py index ecbc60e0..440d8eb9 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -211,7 +211,7 @@ def LOAD(c=None, f='index', args=None, vars=None, request.env.path_info other_request.cid = target other_request.env.http_web2py_component_element = target - other_request.restful = lambda: lambda function: lambda *args, **kwargs: function(*args, **kwargs) # Needed when you call LOAD() on a controller who has some actions decorates with @request.restful() + other_request.restful = request.restful # Needed when you call LOAD() on a controller who has some actions decorates with @request.restful() other_response.view = '%s/%s.%s' % (c, f, other_request.extension) other_environment = copy.copy(current.globalenv) # NASTY