Peter Bengtsson wrote at 2007-1-10 20:23 +0000: >Quite possible that you have a form with something like this: > ><input name="user.age:record" value="50" /> ><input name="user.name:record" value="Dee" /> > >In python, if you do this:: > >def saveUser(self, user, REQUEST): > print user # will print {'age':'50', 'name':'Dee'} > REQUEST.SESSION.set('user_data', user) # will fail! > >So you have to do this:: > >def saveUser(self, user, REQUEST): > user = dict(user) > print user # will print {'age':'50', 'name':'Dee'} > REQUEST.SESSION.set('user_data', user) # will work!
"ZPublisher.HTTPRequest.record" instances (they are used for ":record" form variable) are picklable. Thus, there should be no difference when you store a "record" "r" or "dict(r)" in the session. -- Dieter _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )