Hi all. I know that the request object stores all the informations about the current request, i.e. cookies, server data, form data and input headers. So, i get request using this syntax: r = context.request And using .set it is possible to change values of variables stored in request. Now the question: why r.set( 'name', 'newvalue' ) # changes a variable in 'option' section of request works, and r.set( r.form[ 'variable_in_form' ], 'newvalue' ) does not? I need to modify a variable stored in 'form'! Any hints? Thanks Paolo Dina P.S. An other guy had the same problem (http://mail.zope.org/pipermail/zope/2000-August/116799.html), but no solution was emerged :\
Paolo Dina wrote at 2003-7-11 16:26 +0200:
I know that the request object stores all the informations about the current request, i.e. cookies, server data, form data and input headers.
So, i get request using this syntax: r = context.request And using .set it is possible to change values of variables stored in request. Now the question: why
r.set( 'name', 'newvalue' ) # changes a variable in 'option' section of request works, and
r.set( r.form[ 'variable_in_form' ], 'newvalue' ) does not?
It does, but probably in a different way as you expect: It sets the variable with name obtained by evaluating "r.form['variable_in_form']" to 'newvalue'. When you want to change the variable in the form itself, you can use: r.form.update({'variable_in_form' : 'newvalue'}) Dieter
participants (2)
-
Dieter Maurer -
Paolo Dina