[Zope] overriding manage_beforeDelete in a CatalogAware Product

Andy McKay andym@ActiveState.com
Fri, 17 Nov 2000 09:04:44 -0800


> But I'm confused about how to get rid of the index entry upon delete. I
> think I need to set the catalog name and then call the inherited
> manage_beforeDelete routine. So I tried this:
>
>      def manage_beforeDelete(self, item, container):
>          "Be sure we unindex ourselves from our special catalog"
>          self.manage_editCataloger('CommentCatalog')
>          self.CatalogAware.manage_beforeDelete(item, container)
>
> Not too surprisingly, the code throws an "AttributeError: CatalogAware"
> into the Stupid Log File and doesn't remove the object from
CommentCatalog.
> Of course I don't understand what the correct incantation is, so I'm
> appealing for guidance.

You should just be able to do "self.manage_beforeDelete(..)" since you have
inherited all CatalogAware's methods. Make sure you have CatalogAware as
your first (left most) item in your classes inheritance.

Do you really need to set the catalog again? Isnt that already set in your
class?

--
  Andy McKay, Developer.
  ActiveState.