[Zope] PythonScripts and REQUEST, RESPONSE objects

Stefan H. Holek stefan@epy.co.at
Thu, 08 Mar 2001 17:26:46 +0100


Sorry Phil, this does not work for me in several ways:

a) when I call any DTML Method from a Python Script with 'context' as
the first parameter, I immediatley get
        Error Type: AttributeError
        Error Value: validate
from the __call__

b) I have to use =
        print context.blahblah( _.None, _ )
        return printed
to have anything output at all, and

c) the called DTML Method does not aquire anything =
(possibly because I pass _.None)

Duh! I must be doing something wrong then...

Stefan

--
Things work better when plugged in.


--On Donnerstag, 08. M=E4rz 2001 11:20 +0000 "Mayers, Philip J"
<p.mayers@ic.ac.uk> wrote:

>   context.standard_html_{header,footer}(context,REQUEST)
> =
> Or, if "_" is bound (called from DTML):
> =
>   context.standard_html_{header,footer}(context,_)
> =
> Could this please go in the manual and Zope book?
> =
> Regards,
> Phil
> =
> +----------------------------------+
> | Phil Mayers, Network Support     |
> | Centre for Computing Services    |
> | Imperial College                 |
> +----------------------------------+  =
> =
> -----Original Message-----
> From: Wolfgang Strobl [mailto:ws@gmd.de]
> Sent: 08 March 2001 10:49
> To: zope@zope.org
> Subject: Re: [Zope] PythonScripts and REQUEST, RESPONSE objects
> =
> =
> On 8 Mar 2001, 9:26  Chris Withers wrote:
> =
>> > after line 124 in Pythonscript.py. Now each time I add a new
>> > PythonScript object, it starts with
>> > =
>> > from Products.PythonScripts.standard import html_quote
>> > REQUEST =3D context.REQUEST
>> > RESPONSE =3D context.REQUEST.RESPONSE
>> =
>> Can you stick that in the Collector as a 'Feature w/patch'?
> =
> Done. In addition as an afterhought,  I suggested adding two =
> additional lines
> =
> print "This is Script (Python) ",script.getId(),"("+script.title+") at =
> ",container.absolute_url()
> return printed
> =
> in analogy to the default content of DTML Methods.
> =
> Btw, what's the correct way of rendering the default =
> standard_html_header/footer from within a Python script? =
> =
> --
>       o      (     Wolfgang.Strobl@gmd.de (+49 2241) 14-2394
>      /\        *   GMD mbH                       #include =
>    _`\ `_<=3D=3D=3D      Schloss Birlinghoven,         <std.disclaimer>
> __(_)/_(_)___.-._  53754 Sankt Augustin, Germany ________________
> =
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - =
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> =
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - =
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )