Sven Rudolph wrote:
Hello all,
I have written a small product called MyProduct:
MyProduct(CatalogAware,Implicit,Persistent,RoleManager,PropertyManager,ObjectManager,Item,Historical,Folder): """ """ ...(etc.)
Every time I try to copy&paste, cut&paste an instance of this product I get Error Type: AttributeError Error Value: manage_afterAdd
The traceback is: Traceback (innermost last): File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 114, in publish File /home/medizin/zope/zope-2.5.1/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook (Object: home2) File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 98, in publish File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: manage_pasteObjects) File /home/medizin/zope/zope-2.5.1/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: manage_pasteObjects) File /home/medizin/zope/zope-2.5.1/lib/python/OFS/CopySupport.py, line 160, in manage_pasteObjects (Object: home2) File /home/medizin/zope/zope-2.5.1/lib/python/OFS/ObjectManager.py, line 267, in _setObject (Object: home2) File /home/medizin/zope/zope-2.5.1/lib/python/Products/ZCatalog/CatalogAwareness.py, line 46, in manage_afterAdd File /home/medizin/zope/zope-2.5.1/lib/python/Products/ZCatalog/CatalogAwareness.py, line 46, in manage_afterAdd
BTW. also note that CatalogAwareness.CatalogAware is deprecated, you should be using CatalogPathAwareness.CatalogAware - peter.
AttributeError: (see above)
I understand that this error has something to do with inheriting from CatalogAware. manage_afterAdd is called after paste so the object can tell its default_catalog about its new path I belive.
Since I don't need manage_afterAdd I tried to overwrite it: def manage_afterAd(): """ """ pass
But the error persits...
Can anybody tell me how to solve this problem, or point me to some documentation?
Many, many thanks in advance :-)
Greetings Sven