Ñò Ml4Ic@s dZdefd„ƒYZdS(sèHelpers for the Pylons web framework These helpers depend on Pylons' ``request``, ``response``, ``session`` objects or some other aspect of Pylons. Most of them can be easily ported to another framework by changing the API calls. tFlashcBs,eZdZdd„Zd„Zd„ZRS(sÂAccumulate a list of messages to show at the next page request. This class is useful when you want to redirect to another page and also show a status message on that page, such as "Changes saved" or "No previous search found; returning to home page". THIS IMPLEMENTATION DEPENDS ON PYLONS. However, it can easily be adapted for another web framework. Normally you instantiate a Flash object in myapp/lib/helpers.py:: from webhelpers.pylonslib import Flash as _Flash flash = _Flash() The helpers module is then imported into your controllers and templates as `h`. Whenever you want to set a message, do this:: h.flash("Record deleted.") You can set additional messages too:: h.flash("Hope you didn't need it.") Now make a place in your site template for the messages. In Mako you might do: .. code-block:: mako <% messages = h.flash.pop_messages() %> % if messages: % endif You can style this to look however you want: .. code-block:: css ul#flash-messages { color: red; background-color: #FFFFCC; font-size: larger; font-style: italic; margin-left: 40px; padding: 4px; list-style: none; } tflashcCs ||_dS(N(t session_key(tselfR((s8/usr/lib/python2.6/site-packages/webhelpers/pylonslib.pyt__init__@scCs:ddkl}|i|igƒi|ƒ|iƒdS(Niÿÿÿÿ(tsession(tpylonsRt setdefaultRtappendtsave(RtmessageR((s8/usr/lib/python2.6/site-packages/webhelpers/pylonslib.pyt__call__CscCs3ddkl}|i|igƒ}|iƒ|S(Niÿÿÿÿ(R(RRtpopRR (RRtmessages((s8/usr/lib/python2.6/site-packages/webhelpers/pylonslib.pyt pop_messagesHs (t__name__t __module__t__doc__RR R(((s8/usr/lib/python2.6/site-packages/webhelpers/pylonslib.pyR s3  N(RtobjectR(((s8/usr/lib/python2.6/site-packages/webhelpers/pylonslib.pyts