On Tuesday, June 14, 2011 1:32:36 PM UTC-4, Francisco Costa wrote: 
>
> > But why change this? I always advise not changing this. One thing you 
> could 
> > do instead is: 
> > 
> > def index(): 
> >     redirect('other_controller', 'other_function') 
>
> That solution doesn't work for me because I have some arguments. 
> Is there another way? I use the new routers function on routes.py

 
Actually, redirect takes a URL, so you can pass the args to the URL 
function:
 
redirect(URL('other_controller', 'other_function', args=request.args, 
vars=request.vars))
 
 
I'm not sure I would recommend the redirect method, though -- it generates a 
new request, so introduces an unnecessary delay. It also returns a 303 HTTP 
status code by default (though you can change that to 200 via a second 
argument to redirect).
 
Anthony
 

Reply via email to