tg.flash – Flash

Flash messaging system for sending info to the user in a non-obtrusive way

tg.flash.flash(msg, status=None)

Sets a message to be displayed on the page. This message will survive a redirect.

flash allows to pass in any status, but TurboGears 2 build in three predefined status:

  • status_ok
  • status_warning
  • status_alert

default status: status_ok

tg.flash.get_flash()

Returns the message previously set by calling flash()

Additonally removes the old flash message

tg.flash.get_status()

Returns the status of the last flash messagese

Additonally removes the old flash message status

This Page

Quick search