[Zope] Newbie: need a simple example of external method

Evan Simpson evan@4-am.com
Wed, 13 Oct 1999 22:08:16 +0000


Hung Jung Lu wrote:

> I have noticed that the external methods are only single-level deep.
> That is, they have one-word names, e.g: myMethod. This might
> be a problem in large-scale projects, where it is easy to run into
> name conflicts.
>
> Does anyone know whether internally zope uses the
> "import myModule" and then internally assembles the
> "myModule.myMethod()" call, or does it use
> "from myModule import myFunction"?
>

Neither.  It actually executes the file contents in a clean namespace, so the
file is *not* in any way treated as a module or package.  If you want external
code to live in a proper module or package, it needs to be a Product.  That's
also the proper place to put large, complex code which is at risk of name
conflicts.