Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler
OK, this seems to work. def manage_addMyProduct(self, id, title='', REQUEST=None, RESPONSE=None): self._setObject(id, MyProduct(id, title)) if REQUEST is not None: whereto= REQUEST['URL3'] RESPONSE.redirect(whereto, lock=0) -- .paul winkler...

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler
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 met

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Dieter Maurer
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 h

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler
Phil Harris wrote: > > You need to be careful when redirecting from an external Python wotsit. > > RESPONSE.redirect raises an exception which can make the transaction get > rolled back. > > This seems not to happen when called from dtml but I've seen it happen from > an external Python wotsit.

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler
Michel Pelletier wrote: > > Paul Winkler wrote: (snip) > > Looking through various Zope docs, I thought RESPONSE.redirect might > > work, but RESPONSE is not mentioned anywhere in Boring.py. Boring > > only uses REQUEST. > > So pass it RESPONSE: > > def manage_addMyProduct(self, blah, blah, RE

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Phil Harris
You need to be careful when redirecting from an external Python wotsit. RESPONSE.redirect raises an exception which can make the transaction get rolled back. This seems not to happen when called from dtml but I've seen it happen from an external Python wotsit. Note: My use of wotsit above

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Michel Pelletier
Paul Winkler wrote: > > seb bacon wrote: > > > > * Paul Winkler <[EMAIL PROTECTED]> [001127 19:54]: > > > 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

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread Paul Winkler
seb bacon wrote: > > * Paul Winkler <[EMAIL PROTECTED]> [001127 19:54]: > > 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

Re: [Zope] newbie question: Redirect from Python?

2000-11-27 Thread seb bacon
* Paul Winkler <[EMAIL PROTECTED]> [001127 19:54]: > 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