The Zope Quick Reference version 0.9 lists the RESPONSE variable as having an attribute "set(name, value)" that sets a variable in the request. I tried to use this method to set some variables and the redirct like so: <dtml-call "RESPONSE.set('myVariable', myVariableValue)"> <dtml-call "RESPONSE.redirect(URL1+'/SomeDtmlMethod')"> When I execute the above code I get the following error message Error Type: AttributeError Error Value: set What I would like to achieve is an automatic redirect with my submitted form variable in the new request.
On Wed, 21 Mar 2001, Karl Munroe wrote:
<dtml-call "RESPONSE.set('myVariable', myVariableValue)">
Error Type: AttributeError Error Value: set
<dtml-call "REQUEST.set('myVariable', myVariableValue)"> Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
i didnt find a set() method in the source of lib/python/Products/OFSP/help/Response.py, i think that may be a bug in the ZQR. (disclaimer: i've got zope v2.2.4, maybe it was added later on). i doubt that setting a variable in the REQUEST object with <dtml-call REQUEST.set('myVariable', myVariableValue)"> can be used to pass data across a redirect (but you can try this easily). i would use some kind of session manager to do this, or you could hack your redirect url to look something like '/SomeDtmlMethod?var=value'... - peter. On Wed, 21 Mar 2001, Karl Munroe wrote:
The Zope Quick Reference version 0.9 lists the RESPONSE variable as having an attribute "set(name, value)" that sets a variable in the request.
I tried to use this method to set some variables and the redirct like so:
<dtml-call "RESPONSE.set('myVariable', myVariableValue)"> <dtml-call "RESPONSE.redirect(URL1+'/SomeDtmlMethod')">
When I execute the above code I get the following error message
Error Type: AttributeError Error Value: set
What I would like to achieve is an automatic redirect with my submitted form variable in the new request.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- _________________________________________________ peter sabaini, mailto: sabaini@niil.at -------------------------------------------------
Peter Sabaini wrote:
i didnt find a set() method in the source of lib/python/Products/OFSP/help/Response.py, i think that may be a bug in the ZQR. (disclaimer: i've got zope v2.2.4, maybe it was added later on).
i doubt that setting a variable in the REQUEST object with
<dtml-call REQUEST.set('myVariable', myVariableValue)">
can be used to pass data across a redirect (but you can try this easily).
i would use some kind of session manager to do this, or you could hack your redirect url to look something like '/SomeDtmlMethod?var=value'...
- peter.
On Wed, 21 Mar 2001, Karl Munroe wrote:
The Zope Quick Reference version 0.9 lists the RESPONSE variable as having an attribute "set(name, value)" that sets a variable in the request.
I tried to use this method to set some variables and the redirct like so:
<dtml-call "RESPONSE.set('myVariable', myVariableValue)"> <dtml-call "RESPONSE.redirect(URL1+'/SomeDtmlMethod')">
When I execute the above code I get the following error message
Error Type: AttributeError Error Value: set
What I would like to achieve is an automatic redirect with my submitted form variable in the new request.
RESPONSE.set is an ancient artifact that is merely exposing the out of date nature of the ZQR. At any rate the problem you are running up against is the stateless nature of HTML. There are several ways to accomplish your goal: 1. Pass the values again by populating hidden fields on a form and submitting the form. 2. Pass the values by explicitly rewriting URLs with the variable/values you want. 2. Store the values in a Cookie. 3. Use a session management tool. There are several available for Zope. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (4)
-
Casey Duncan -
Karl Munroe -
Oleg Broytmann -
Peter Sabaini