[Zope] Searching for a variable from ZPT.

Chris McDonough chrism at plope.com
Fri Sep 24 18:33:10 EDT 2004


On Sun, 2004-09-19 at 21:35, Paul Winkler wrote:
> On Sun, Sep 19, 2004 at 10:10:15AM -0700, Jason Leach wrote:
> > Is their an easy way to search for a var in REQUEST?  In my ZPT I have
> > a look in REQUEST.SESSION, options and REQUEST.form for a var; it can
> > get passed in several ways depending on what calls the ZPT.
> > 
> > I would like one clean way. Not three conditions in my ZPT.
> 
> You don't have to. The HTTPRequest class (or maybe one of its base
> classes) automagically combines all its categories, so 
> request/foo should work regardless of whether it's in session, options,
> form, other...

Not quite.  REQUEST.SESSION needs to be explicitly used. 
REQUEST.sessionvariable won't work.  This was an explicit decision at
design time, although maybe one that isn't quite in the spirit of Zope
2.

- C


>  



More information about the Zope mailing list