On Aug 28, 2011, at 3:05 PM, Massimo Di Pierro wrote:

> Technically you can do:

But only in the same controller.

> 
> 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)

Yeah, I was thinking along those lines. Not sure if it's worth it, and it'd be 
easy to misuse, but a full redirect is pretty expensive (time, not cycles).

> 
> 
> 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.


Reply via email to