Here is the code I added to app_globals.py in order to override the default 
TGFlash class:

class LinkReadyTGFlash(TGFlash):
    """
    This class inherits from (and is used in place of) TGFlash
    in order to allow to include links in flash messages.
    """

    def _render_static_version(self, container_id):
        payload = self.pop_payload()
        if not payload:
            return ''

        # HACK - THIS IS A PATCH
        if payload.get('no_escape'):
            payload['message'] = payload.get('message','')
        else:
            payload['message'] = escape(payload.get('message',''))

        payload['container_id'] = container_id
        return self.static_template.substitute(payload)

# Override the default flash with the Specific one
tg.flash = LinkReadyTGFlash.create_global()


Thank's Alessandro.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to