[Zope] PythonScripts and REQUEST, RESPONSE objects

Mayers, Philip J p.mayers@ic.ac.uk
Thu, 8 Mar 2001 11:20:23 -0000


  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 = context.REQUEST
> > RESPONSE = 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 
   _`\ `_<===      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 )