I am going with this solution for a multicomponent app(working together with
web2py components), I just do not know if I can rely on this inner
functions, the return of locals() and the use of inspect. without the chance
to break the compatibility in the future.
####################################################
def wrapper():
div = DIV('wrapper',BR(),HR())
otherdiv = DIV('This is another div')
def function1():
div = DIV('function 1',BR(),HR())
response.view = 'default/wrapper/function1.html'
return locals()
def function2():
div = DIV('function 2',BR(),HR())
response.view = 'default/wrapper/function2.html'
return locals()
from inspect import isfunction as __isfunction
if not request.args(0) in locals():
return locals()
elif __isfunction(locals().get(request.args(0))):
return locals().get(request.args(0),locals)()
else:
return locals().get(request.args(0),locals)
#################################################
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]