Technically you can do:
def a():
if request.vars.test:
response.view = 'default/b.html'
return b()
return dict()
def b():
return dict()
Anyway, take a look at these lines in main.py:
http_response, new_environ = rewrite.try_rewrite_on_error(
http_response, request, environ, ticket)
if not http_response:
return wsgibase(new_environ,responder)
perhaps we can use them to implement a redirect(URL(), local=True)
On Aug 28, 4:40 pm, Jonathan Lundell <[email protected]> wrote:
> On Aug 28, 2011, at 2:26 PM, Bruno Rocha wrote:
>
> > Proxy is a great idea, but I would like to keep the url as it is.
>
> > I will make account the default controller, and in account I will create a
> > proxy to redirect to the index page if passed /index, or something like
> > this.
>
> It'd be nice to have a local redirect. I wonder if that's practical.
> Something to tell the web2py dispatcher to redirect to a different
> controller/function without going back to the client.