[Zope] context in Python Script

Michel Pelletier michel@digicool.com
Tue, 28 Nov 2000 10:28:02 -0800


Chris Gray wrote:
> 
> I still can't get external Python Scripts to work as described in the Zope
> Book.  I am using the version of Python Scripts from the public
> CVS.  Internal Scripts work fine, but I can't seem to use the
> "context" object in an external script.
> 
> def tryContext():
>     """tryContext function"""
>     return context.objectIds()
> 
> gives a NameError on context.

Look at your 'Bindings' tab.  The 'context' binding should be
'context'.  If it's something else (like 'self') then change it.

Basicly, 'container' should be 'self' and 'context' should be 'context'.

-Michel