python(script) passing parameters with RESPONSE.redirect
if I call from a python script... context.REQUEST.RESPONSE.redirect(context.WhereTo.absolute_url()) is it possible to pass some parameters along with the redirect? Can these parameters be set so they may become part of the REQUEST for the WhereTo object?
On ma, 21.07.2003 at 17:52 -0400, AdvertisingDept wrote:
if I call from a python script...
context.REQUEST.RESPONSE.redirect(context.WhereTo.absolute_url())
is it possible to pass some parameters along with the redirect?
This is how we usually do it: from ZTUtils import make_query args=make_query(message=msg) url = 'editPropertiesForm?'+args+'#researchers' request.response.redirect(url) The same can, of course, be accomplished this way: request.response.redirect('editPropertiesForm?message='+msg+'#researchers') But for bigger sets of parameters, the first way is a little bit nicer to look at.
Can these parameters be set so they may become part of the REQUEST for the WhereTo object?
Parameters passed in the url will be a part of REQUEST. -- paavo. "joskus voi tää meno käydä ahdistavaksi kun on täällä muodostunut tavaksi muuttaa jokaisen elämän arvo rahaksi"
Hi AdvertisingDept, (silly realname that is ;)) AdvertisingDept wrote:
if I call from a python script...
context.REQUEST.RESPONSE.redirect(context.WhereTo.absolute_url())
is it possible to pass some parameters along with the redirect?
Can these parameters be set so they may become part of the REQUEST for the WhereTo object?
You can always append URL variables, to make it easy, there is a function: from ZTUtils import make_query querystr=make_query({'foo':1, 'bar':'hello'}) context.REQUEST.RESPONSE.redirect(context.WhereTo.absolute_url()+'?'+querystr) HTH Tino Wildenhain
participants (3)
-
AdvertisingDept -
Paavo Parkkinen -
Tino Wildenhain