Problem with "Python Script" in Zope-2.2.x-to-2.2.4-win32-x86.tgz or in my brain???
I just upgraded Zope on my Win 2K machine with Zope-2.2.x-to-2.2.4-win32-x86.tgz But I cannot find "Python Methods" or "Python Scripts" anywhere. Is it me being stupid or is the product missing from that tarball?? Regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Specialization is for insects. - Robert A. Heinlein
From: "Max M" <maxmcorp@worldonline.dk>
I just upgraded Zope on my Win 2K machine with Zope-2.2.x-to-2.2.4-win32-x86.tgz But I cannot find "Python Methods" or "Python Scripts" anywhere. Is it me being stupid or is the product missing from that tarball??
Python Scripts won't enter the core until 2.3, so for now you would need to either check them out of CVS, or download the older thirdy-party PythonMethods Product from zope.org. Cheers, Evan @ digicool & 4-am
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. ---------- def tryContext(context): """tryContext function""" return context.objectIds() with the "Try It" tab, no form for passing parameters comes up and the complaint is that the context parameter was omitted from the request. ----------- <dtml-var tryContext> to the first example above gives the same NameError on context and to the second example gives "a not enough arguments" TypeError ----------- It only seems to work when explicitly passing an argument like <dtml-var "tryContext(this())"> but I thought that context was supposed to be bound to an object by default as it is with an Internal Script. Cheers, Chris
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
D'oh! Thanks, Michel. That was the problem. Right now bindings all default to blank in a new external script. Cheers, Chris On Tue, 28 Nov 2000, Michel Pelletier wrote:
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
Max M wrote:
I just upgraded Zope on my Win 2K machine with Zope-2.2.x-to-2.2.4-win32-x86.tgz But I cannot find "Python Methods" or "Python Scripts" anywhere. Is it me being stupid or is the product missing from that tarball??
Python Scripts will not be included in Zope until the 2.3 release. For now, you will need to check them out of CVS. -Michel
participants (4)
-
Chris Gray -
Evan Simpson -
Max M -
Michel Pelletier