[Zope] namespace problems

Chris Withers chrisw@nipltd.com
Mon, 29 Jan 2001 16:03:00 +0000


Gary Lowder wrote:
> 
> When I use "context.REQUEST.RESPONSE.redirect(URL1)" in my python script
> I get "NameError URL1".

That should be:
RESPONSE = context.REQUEST.RESPONSE
URL1 = context.REQUEST['URL1']
RESPONSE.redirect(URL1)

> When I bind _ as you suggested, and use "_.RESPONSE.redirect(URL1)" I
> get "AttributeError RESPONSE".

Try _['RESPONSE'].redirect(_['URL1'])

errr... maybe DTML wasn't so bad afterall ;-)

*sigh*

Chris