[Zope] I really screwed up.

Dieter Maurer dieter at handshake.de
Mon Mar 22 14:37:25 EST 2004


Joe Goldthwaite wrote at 2004-3-22 09:51 -0700:
> ...
>Here's my problem.  I'm using external methods extensively.  My Zope
>instance is c:\website.  My external modules are in c:\website\extensions.
>I've got two modules; Externals.py and BarsDB.py.  Externals.py imports
>BarsDB.  This was all working on Zope 2.6.2.

The sources containing External Methods are not imported
but read in a special way. Therefore, importing a module "m"
in "Extensions" with "import m" usually does not work.

This is documented behaviour (read about "External Methods" in
the Zope Book 2.6 Edition). The documentation suggests to
move requisite resources (such as other modules) in true
Python packages (and modules) below "Shared/<yourCompany>"
and import them via "from Shared.<yourCompany>.... import <yourResource>".

There are several alternatives:

  *  let "PYTHONPATH" cover the "Extensions" directory

  *  make "Extensions" a Python package and let
     "PYTHONPATH" cover its parent directory.

     Then you can access the modules via "from Extensions import m".


-- 
Dieter



More information about the Zope mailing list