Merge pull request #485 from dokime7/patch-5
Fix LOAD on action @request.restful()
This commit is contained in:
+2
-1
@@ -38,6 +38,7 @@ import marshal
|
||||
import shutil
|
||||
import imp
|
||||
import logging
|
||||
import types
|
||||
logger = logging.getLogger("web2py")
|
||||
from gluon import rewrite
|
||||
from custom_import import custom_import_install
|
||||
@@ -211,7 +212,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 = request.restful # Needed when you call LOAD() on a controller who has some actions decorates with @request.restful()
|
||||
other_request.restful = types.MethodType(request.restful.im_func, other_request) # A bit nasty but needed to use LOAD on action decorates with @request.restful()
|
||||
other_response.view = '%s/%s.%s' % (c, f, other_request.extension)
|
||||
|
||||
other_environment = copy.copy(current.globalenv) # NASTY
|
||||
|
||||
Reference in New Issue
Block a user