[Zope] Re: losing random session data

Norbert Marrale norbert at vsmpro.com
Mon Mar 19 15:57:08 EDT 2007


Maciej Wisniowski wrote:
> This seems to be hardcore ;) I mean that it should not
> be necessary to do such rewrite of all keys and values
> for dictionaries or lists taken from session.
> I never had to do something like that...
> 
> Isn't it working without these assignments? Just:
> 
> order=req.SESSION.get('order', []) # if there is no 'order' in session
>                                    # you'll simply get empty list here
> new_order = {}
> for val in req.form.keys():
>     new_order[val]=req.form[val]
> order.append(new_order)
> req.SESSION['order'] = order
> 
> 
> BTW. req.SESSION.set(..., ...) method is also persistence aware
> (according to zope book)

I discovered this too, after posting. You are absolutely correct!

Thanks again,

Norbert



More information about the Zope mailing list