Web-callable functions that encapsulate external python functions.
The function is defined in an external file. This file is treated
like a module, but is not a module. It is not imported directly,
but is rather read and evaluated. The file must reside in the
Extensions subdirectory of the Zope installation, or in an
Extensions subdirectory of a product directory.
Due to the way ExternalMethods are loaded, it is not currently
possible to use Python modules that reside in the Extensions
directory. It is possible to load modules found in the
lib/python directory of the Zope installation, or in
packages that are in the lib/python directory.
Methods
|
|
__call__
manage_edit
|
|
__call__
|
__call__ (
self,
*args,
*kw,
)
Call an ExternalMethod
Calling an External Method is roughly equivalent to calling
the original actual function from Python. Positional and
keyword parameters can be passed as usual. Note however that
unlike the case of a normal Python method, the "self" argument
must be passed explicitly. An exception to this rule is made
if:
The supplied number of arguments is one less than the
required number of arguments, and
The name of the function's first argument is self .
In this case, the URL parent of the object is supplied as the
first argument.
|
|
manage_edit
|
manage_edit (
self,
title,
module,
function,
REQUEST=None,
)
Change the external method
See the description of manage_addExternalMethod for a
description of the arguments module and function .
Note that calling manage_edit causes the "module" to be
effectively reloaded. This is useful during debugging to see
the effects of changes, but can lead to problems of functions
rely on shared global data.
|
|