[Zope-dev] urg
James Henstridge
james@daa.com.au
Tue, 7 Mar 2000 18:23:12 +0800 (WST)
On Tue, 7 Mar 2000, Tom Deprez wrote:
> Thanks for the reply James,
>
> I do import the ClassAwareness library, but perhaps here is the mistake.
> Here is my full python script (and my first).
>
> import sys
> sys.path.append('usr/local/zope/lib/python/Products/ZCatalog')
> import CatalogAwareness
Either change this line to
from CatalogAwareness import CatalogAware
> """ CatalogAwareness contains the CatalogAware Class """
>
> def manage_afterAdd(self,item,container)
> item.myparent=container.id
> CatalogAware.manage_afterAdd(self,item,container)
or change this line to:
CatalogAwareness.CatalogAware.manage_afterAdd(...)
> return
>
> I also tried this, but it always gives the same error :
>
>
>
> Thanks, Tom.
>
Either of those should fix the problem. Just remember that "import ..."
imports the _module_ into the current namespace, and "from ... import ..."
imports things _from_ the module into the current namespace. Which
solution you choose depends on your coding style.
James.