Don't do it that way. Instead, abstract whatever is common to controller1method and controller2method into a separate function, and put that function in a model file (which will make it accessible in either controller) or a module (and import where needed).
Call controller's method from another controller
-
04-07-2023 - |
문제
I have an application in web2py. I have two controllers in it. Now I want to call a method written in one controller from other controller. How do I do that.
Example - In controller 1:
def controller1method():
return 'something'
In controller 2:
def controller2method():
# how do I call controller1method here
해결책
제휴하지 않습니다 StackOverflow