[Zope] python(script) passing parameters with RESPONSE.redirect

Paavo Parkkinen pparkkin@verso.st.jyu.fi
Tue, 22 Jul 2003 05:43:07 +0300


On ma, 21.07.2003 at 17:52 -0400, AdvertisingDept wrote:
> if I call from a python script...
>=20
> context.REQUEST.RESPONSE.redirect(context.WhereTo.absolute_url())
>=20
> is it possible to pass some parameters along with the redirect?

This is how we usually do it:
  from ZTUtils import make_query
  args=3Dmake_query(message=3Dmsg)
  url =3D 'editPropertiesForm?'+args+'#researchers'
  request.response.redirect(url)

The same can, of course, be accomplished this way:
  request.response.redirect('editPropertiesForm?message=3D'+msg+'#researc=
hers')

But for bigger sets of parameters, the first way is a little bit nicer
to look at.

> Can these parameters be set=20
> so they may become part of the REQUEST for the WhereTo object?

Parameters passed in the url will be a part of REQUEST.

--=20
paavo.

 "joskus voi t=E4=E4 meno k=E4yd=E4 ahdistavaksi
  kun on t=E4=E4ll=E4 muodostunut tavaksi
  muuttaa jokaisen el=E4m=E4n arvo rahaksi"