Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

moschlar/tgext.flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tgext.flash

Advanced Flash Extension for TurboGears 2 that supports template customization and displaying multiple flash messages in one request.

Usage:

Install with easy_install https://github.com/moschlar/tgext.flash/archive/master.tar.gz#egg=tgext.flash-0.1

Use in your controller like

from tg import TGController, expose, tmpl_context
from tgext.flash import flash

class BlaController(TGController):

    def _before(self, *args, **kw):
        tmpl_context.flash = flash

    @expose(...)
    def index(self):
        flash("First message", "ok")
        flash("<b>Second</b> message", "warning", no_escape=True)
        return dict(...)

and in your (Mako) template like:

${c.flash() | n}

TODO:

  • Monkeypatching
  • Maybe use tgext.pluggable
  • Allow customization (templates) per app_config
  • Allow real templates to be used
  • Make JS stuff working
  • Consider making the flash object a ToscaWidgets widget to have their rendering engine bindings

About

Advanced Flash Extension for TurboGears 2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages