CatalogAware, external method manage_afterAdd
Hi, I'm once again trying to get further in my test products. * I've created a catalogAware ZClass, called KBItem * KBItem contains an external method with id manage_afterAdd Now, I can add KBItem instances in Zope without problems, BUT! when having a ZCatalog inside a folder with the id Catalog and then try to create a KBItem instance, I get following error (where testje is the id of the KBItem I try to create) : Zope has encountered an error while publishing this resource. Error Type: ValueError Error Value: Uncatalog of absent id 'TEST_Folder/testje' Help! I don't know what I'm doing wrong or what is happening! What does it mean and what can I do? Thanks in advance, Tom.
Hi Tom, This might be because the CatalogAware class uses the manage_afterAdd hook itself (CatalogAwareness.py). In _your_ manage_afterAdd(self, item, container), try this (untested): def manage_afterAdd(self, item, container): # do whatever want to CatalogAware.manage_afterAdd(self, item, container) Hope this works. Shalabh
Great idea! However, no I get this error : Zope has encountered an error while publishing this resource. Error Type: NameError Error Value: CatalogAware Do I've to place somewhere an import of the CatalogAwareness library? I'm afraid my knowledge of Python is to low to solve this correctly. Any ideas? Tom. At 23:46 03/03/2000 +0530, Shalabh Chaturvedi wrote:
Hi Tom,
This might be because the CatalogAware class uses the manage_afterAdd hook itself (CatalogAwareness.py).
In _your_ manage_afterAdd(self, item, container), try this (untested):
def manage_afterAdd(self, item, container): # do whatever want to CatalogAware.manage_afterAdd(self, item, container)
Hope this works.
Shalabh
participants (2)
-
Shalabh Chaturvedi -
Tom Deprez