[Zope] PythonScripts and REQUEST, RESPONSE objects

Chris Withers chrisw@nipltd.com
Wed, 07 Mar 2001 09:54:47 +0000


Alex Verstraeten wrote:
> 
> This brings me 2 problems:
> the syntax is much longer, instead of having:
> <dtml-var MyMethod>
> I have to type now:
> <dtml-var "MyMethod(RESPONSE=RESPONSE , REQUEST=REQUEST)">
> 
> the other problem is that from now on this object requires to be called from
> a dtml-method (because it needs these RESPONSE and REQUEST objects as
> parameters)
> 
> is there a cleaner solution than doing this?

Yup, the following two lines at the start of your script: ;-)

REQUEST = context.REQUEST
RESPONSE = context.REQUEST.RESPONSE

It'd be nice if Python Scripts did that for you, I wonder if there's any reason
they don't?

cheers,

Chris