[Zope] binding to 'context' from a Python product

Jim Anderson ezjab at ieee.org
Sun May 2 17:57:09 EDT 2004



I've reading Zope documentation and python/lib modules and
have not found a way to bind to the current folder context when
I run my python product in Zope 2.7.

I'm creating the product with a member function, ex(). So
for example, if my product is 'sample' and the member function
is 'ex', I try executing 'sample.ex()'. Inside ex(), I have the
following code:

    def ex(self):
        request = context.REQUEST

The product loads ok, but when ex() is called, I get an
error message:

    Error Type: NameError
    Error Value: global name 'context' is not defined

Thanks in advance for any tips.




More information about the Zope mailing list