On 5/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> These are good tips.  Here's a related suggestion for 2.0: make the
> flash work like a logger.  For example:
>
> turbogears.flash.info("An informational message...")
> turbogears.flash.error("A big freakin' error!")
>

That's a nice syntax.  I've created my own version of tg.flash that
takes the class as a second argument and defaults to whatever I set it
in my app.cfg, e.g:

myproject.flash("An informational message...")
myproject.flash("A big freakin' error!", "error")

Still, that alone doesn't solve the issue of adding things like links
to your flash message.  In the end I gave up trying to hack tg.flash
and cookies to show messages and started using cherrypy.request to
store status messages.  Since the data is still in pure python and
hasn't required serialisation into a cookie you can store elementtree
elements for direct output of links etc.

I'm not 100% sure what the best practice is for storing data in
cherrypy.request but I use it fairly liberally for this kind of thing.

I don't have any code that I can post at the moment as it's too
tightly tied with the project, but if there's some interest I could
probably break it out and publish it.

Lee

-- 
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com
skype: fireflisystems

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to