Re: [Zope] newbie question: Redirect from Python?
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
Dieter Maurer wrote:
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).
Well, I don't have that method. Went to learn about what people use it for - searched for manage_afterAdd on zope.org and got nothing at all??? Anyway, I'm now redirecting in manage_Add and it seems to work fine. -- ................. paul winkler .................. slinkP arts: music, sound, illustration, design, etc. web page: http://www.slinkp.com A member of ARMS: http://www.reacharms.com
participants (2)
-
Dieter Maurer -
Paul Winkler