[Zope] Accessing Zope REQUEST data from a Python module

Sascha Welter zopelist at betabug.ch
Thu Dec 6 12:20:00 EST 2007


(Wed, Dec 05, 2007 at 07:35:22PM -0500) Ken Winter
wrote/schrieb/egrapse:
> I'm customizing a product.  To do what I'm trying to do, I need to be able
> to access REQUEST data from within a Python module (not a script; a .py file
> containing class and method definitions).

Usually REQUEST is handed down to your method, as in:

    def mymethod(self, someparameter, REQUEST=None):

and you then test for REQUEST not being None to determine if your method
was called through a web browser or from another method.

But... why don't you just follow one of the tutorials or sample products
for making Zope Products?
http://wiki.zope.org/zope2/DiskBasedProduct
If I may say so myself, I'd recommend the newest one:
http://papakiteliatziar.gr/BetaBoring

Also very nice is the tutorial linked from the ZopeStarter page
http://wiki.zope.org/zope2/ZopeStarter
which is at
http://www.upfrontsystems.co.za/courses/zope

Regards,

Sascha




More information about the Zope mailing list