On Aug 28, 2006, at 10:14 AM, Adam Jones wrote:
I'ts both stored in a cookie and sent in "tg_flash" to the template so both of the following snippets can work: 1) def controller_method(....): # save data flash("Your data was saved") redirect(...) 2) def controller_method(....): if a: flash("a is true") return dict(...) As you can see, 1) is issuing a HTTP redirect so the only way to store state between this request and the one answering the redirect is with a cookie. In 2) the message is just stored in tg_flash and shown in the same request. As it has been mentioned, you can store almost anything in tg_flash if you encode it in JSON and process it client-side with _javascript_.. You can look at an example of using this technique here: HTH, Alberto. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
- [TurboGears] Re: multi-flash? isaac
- [TurboGears] Re: multi-flash? Alberto Valverde
- [TurboGears] Re: multi-flash? Kevin Horn
- [TurboGears] Re: multi-flash? Jorge Godoy

