[Zope] Loop over the different levels of PARENTS

Max M maxm@mxm.dk
Tue, 11 Jun 2002 14:46:28 +0200

Nico de Boer wrote:

>I've tried the default_catalog call, but this refers to default in
>CatalogAwareness.py and has the value Catalog.
>But I want to give the site owner the opportunity to give the ZCatalog
>an id that I look for afterwards. 
>Or am I using the self.default_catalog call in the wrong way?

As you can see from the code::

    def index_object(self):
        """A common method to allow Findables to index themselves."""
        if hasattr(self, self.default_catalog):
            getattr(self, self.default_catalog).catalog_object(self, 

A catalog aware object indexes itself in the default catalog.

Just putting in a catalog with another name somewhere above the object 
you want indexed doesn't make the object catalog itself in that catalog.

You can catalog any object in any catalog you want by using "find & 
index" from the catalog. But if you want the object to be automatically 
cataloged in another catalog than "Catalog" you need to set that objects 
"default_catalog" attribute.

regards Max m


"Sorry I would Really Like To Help More On This Project,
But Am To Busy Doing Paid Work On A Tight Deadline"
    Max M