[Zope] Storing things in the session from ZPT

Chris Withers chris at simplistix.co.uk
Fri Feb 24 16:22:08 EST 2006


> On 24 Feb 2006, at 12:49, Robert (Jamie) Munro wrote:
> 
>> How can I put something in a session from ZPT?
>>
>> I've tried:
>>
>> <div tal:define="session/foo request/foo">
>> <div tal:define="foo python:session['foo']=request['foo']">
>>
> Isn't it
> <div tal:define="foo python:request.SESSION.set('foo', request['foo'])">

Doing this kind of logic from ZPT is evil :-(

>> Do I really have to write a python method just to assign a single value?

Yes, put all you logic in a python script. See Zope 3 views for an event 
cleaner way :-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list