[Zope] RE: Importing Products into my Custom Product....

Bill Hewitt wphewitt at comcast.net
Sat Sep 11 14:52:16 EDT 2004


I  am asking this question again in hopes that maybe this time it will
make more sense....

What I want to do is reuse code from one product to the next in a Python
Class...... This is trivial in a ZClass, but ????

Anyway, I create a new Python Product "FOO" and I want to import the
methods of another Python Product "Bar" ("FOO" and "BAR" are next to
each other in the Products Directory), so I add 
"import Bar" into my __init__.py file for "FOO"

When I do this, the ZServer complains that the module does not
exist..... So, I try:
"from Bar import Bar" and "from Bar.Bar import Bar" and "from
Products.Bar import Bar"

Again the ZServer complains that the module does not exist -even though
they *do* exist right next to each other in the same "Products"
Directory.....

How do I get one product to use (reuse) the methods of another product
that also exists in the "Products" Directory?

WPH



More information about the Zope mailing list