On Wed, Aug 5, 2009 at 12:20 AM, El Tea<[email protected]> wrote:
>
> In TG1, the only redirects I ever saw were handled as exceptions.  In
> TG2 I've seen two forms:
>
> redirect('/somewhere')
>
> raise tg.redirect('/somewhere')
>
>
> Is there a "right" time to do one vs. the other?  Is one more correct
> than the other?  One thought I've had is that the raise may be used if
> you want to indicate that any database transactions from that request
> should be discarded (I think this is done on exceptions).
>
both are ok.

The second one was to keep compatibility with TG1, I use
redirect('foo') as it is shorter (in the back it's doing the exception
thing)

> Thoughts?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to