[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Advanced Zope Scripting
nobody@nowhere.com
nobody@nowhere.com
Fri, 23 Aug 2002 09:05:37 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/ScriptingZope.stx#2-31
---------------
You've created a Python function in a Python module. Now let's use
this function in the External Method.
% Anonymous User - Aug. 23, 2002 8:44 am:
Let's say i write a python module myModule.py with two functions (funct1 and funct2) in it. Is it possible to
have the same External Method (say extM) referring myModule.py and executing funct1 *OR* funct2 upon need? I
would like to call the method through the web with something like .../extM/funct1 or .../extM/func2 depending
on run time considerations.
Put another way, an external method points a function (inside a python module) or can be bound dynamically to
any function of that module?
% Anonymous User - Aug. 23, 2002 9:05 am:
No... but you could define three functions in the module, use one as an external method, and have it call one
of the other two functions in the same module based on runtime considerations.