On 7/8/09 2:54 AM, Iain Duncan wrote: > On Wed, 2009-07-08 at 02:36 -0400, Chris McDonough wrote: >> We don't have a convention for "flash". I've been remiss in seeing how the >> other frameworks implement this, but I *think* something like this would be >> closest: >> >> return render_template_to_response('some/template.pt', message='Updated') >> >> And in the template: >> >> <div class="someclass">${message}</div> > > Thanks Chris. The convention in the other frameworks that I've used is > that the message is 'flashed' when handling the update from a post, and > displayed after the redirect, to avoid the problem when a user hits > resend after a post that should not occur twice. So usually the flash > helper is a simple utility to set, read, and wipe a session variable or > cookie. I guess bfg is not making any assumptions about session vars or > cookies though?
Since BFG depends on no particular persistence mechanism, BFG has no built-in session support, although I often use this pair of packages to get it: http://pypi.python.org/pypi/repoze.browserid/0.1 http://pypi.python.org/pypi/repoze.session/0.2 Of course any sessioning system would work just as well (ala Beaker). > If you are thinking of adding such a thing to bfg, I'll hold off on my > own ( or use a really crappy one ). No, I'm not. > Can we set a simple cookie with > webob maybe as an ultralight version that doesn't depend on a particular > method of storing session vars? Sure, although I'm not sure that requires any particular API support from BFG. - C _______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev