On Sat, 2007-15-12 at 15:00 +0000, Alberto Valverde wrote:
> Mark Ramm wrote:
> > Oh, I think I know what's happening here. This is something I didn't
> > think about when we created our own turbogears baseapp, and took
> > pylons out of the picture, I think redirect_to is trying to use routes
> > to do redirection...
> >
> > For now, you ought to be able to just the other function by naming it
> > directly and then return it's return value, but I think we need to
> > look into writing a TurboGears specific redirect_to function.
>
> How about a tg.redirect instead that mimics TG1's? A modified
> redirect_to function will probably confuse anyone coming from Pylons if
> it doesn't use routes internally (since you can do things like
> redirect_to('named_route')).
>
> Something like this (untested code) could be it:
>
> def redirect(redirect_path, redirect_params=None, **kw):
> params = redirect_params or {}
> params.update(kw)
> if params:
> url += '?' + urllib.urlencode(params, True)
> raise paste.httpexcetions.HTTPSeeOther(url)
I'm +1 on that. IMHO it should either:
a) work just like the pylons docs or with very minor alteration
b) be a TG function that looks like the old one to a TG user
Thanks
Iain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---