[web2py] Re: Changing the controller on the fly

2012-05-11 Thread simon
You can do: def dispatch(): controller,function = ... load these from the database ... redirect(URL(c=controller, f=function, vars=request.vars, args=request.args)) On Friday, 11 May 2012 10:17:19 UTC+1, Michael Toomim wrote: I need to be able to dispatch to a different

[web2py] Re: Changing the controller on the fly

2012-05-11 Thread Anthony
Or to avoid a redirect, you can change the function and controller in a model file: db = DAL(...) if request.function == 'dispatch': request.controller, request.function = [fetch from db] response.view = '%s/%s.%s' % (request.controller, request.function,request .extension)

[web2py] Re: Changing the controller on the fly

2012-05-11 Thread Michael Toomim
This is working great! It's exactly what I needed, and makes my code much simpler. Thank you very much! I love it! On Friday, May 11, 2012 5:03:51 AM UTC-7, Anthony wrote: Or to avoid a redirect, you can change the function and controller in a model file: db = DAL(...) if