Richard Clark ha scritto:
>
>> Why is the url not properly displayed when you return self.secondpage?
>>
>
> Because if you do the return, you are essentially substituting one
> call for another, rather than redirecting to it.
>
>
>> When you finish with page1 handler and you do:
>> return self.secondpage( tg_errors, data )
>> the url is localhost:8080/firstpage_handler
>>
>> but using redirect the url is properly displayed.
>> raise tg.redirect( tg.url("secondpage", tg_errors=None, **data) )
>> localhost:8080/secondpage
>>
>> What is a proper way to do it?
>>
>
> it depends on your requirements, I use return when I want to pass
> validated info in, I use redirect otherwise.
>
>
>
Yes, some other change are:
return can handle structured data as nested dict, but you cannot change
data value inside method.
raise you can change data value, but you cannot hanlde nested dict (as
fieldset, nested tables, etc..)
Glauco
--
+------------------------------------------------------------+
Glauco Uri - Programmatore
glauco(at)allevatori.com
Sfera Carta Software(r) [EMAIL PROTECTED]
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---