On Wed, Mar 28, 2012 at 11:29:17AM -0700, Eric Rasmussen wrote: > If you're looking for a way to attach messages to the session in Pyramid, > see: > http://readthedocs.org/docs/pyramid/en/latest/narr/sessions.html?highlight=flash#flash > > I mostly use Mako, but from past experimentation I think the Chameleon > version goes something like this: > > <ul id="flashmessages">
Small (untested) improvement, mostly to draw attention to the
peek_flash() method:
<ul id="flashmessages" tal:condition="request.session.peek_flash()">
> <li tal:repeat="msg request.session.pop_flash()">
> <span tal:content="msg"></span>
> </li>
> </ul>
>
> Hope that helps you get started,
> Eric
> On Wed, Mar 28, 2012 at 9:08 AM, Joshua Partogi
> <[email protected]>wrote:
> > I would like to display a flash message in the stack on the template. What
> > would be the safest approach to do this? I am using Chameleon ZPT template.
> > I tried to find the information on the web without any luck.
http://readthedocs.org/docs/pyramid/en/1.0-branch/narr/sessions.html is
hit #1 on Google for "pyramid flash message" ;)
(Same page as Eric pointed out, but for older version of Pyramid; with
links to newer versions discretely hidden in the 'read the docs' float on
the bottom right. Besides, the request.session.flash API did not change
between Pyramid 1.0 and 1.3, as far as I know.)
Marius Gedminas
--
Microsoft is not the answer.
Microsoft is the question.
"No" is the answer.
signature.asc
Description: Digital signature
