Fancy TurboGears "Flash" Messages

Lee has a great article on making the TurboGears “flash” functionality more useful. “tg_flash” or “turbogears.flash” in 0.9 is a method used to set a status message on the next page to be displayed. In its default form this allows you to send some plain text or HTML to the page.

I was looking for a way to pass more information using this mechanism to indicate success or failure of an operation so that the message can be styled properly and Lee presents a great solution to this problem:

Fancy status messages using tg_flash