[Zope] newbie question: Redirect from Python?
Dieter Maurer
dieter@handshake.de
Tue, 28 Nov 2000 00:22:08 +0100 (CET)
Paul Winkler writes:
> I want the user to be sent to a particular URL after calling the
> product's manage_add method. How can I do that?
> The URL I want is REQUEST['URL3'].
>
> I've tried RESPONSE.redirect(REQUEST['URL3']) but that's not it - the
> RESPONSE doesn't seem to exist here.
I hope, you do not need the redirect in your constructor
as in the constructor the newly created object is not yet
tied into the web site hierarchy via acquisition.
If the object, say "self", is already tied in, then
you can use "self.REQUEST.RESPONSE.redirect(....)".
If you need it in the constructor, then you must
either pass in an object that is tied by acquisition
or REQUEST or RESPONSE itself,
or you must move the call out into the method
"manage_afterAdd" (where the object already is tied in).
Dieter