[Zope] How to get a catalogware object's ZCatalog

Oliver Bleutgen myzope@gmx.net
Fri, 06 Jun 2003 14:33:55 +0200


Nico Grubert wrote:
>>Such an object should have an attribute named default_catalog.
>>
>>So, getattr(myobj,myobj.default_catalog) should give you the catalog 
>>object via acquisition.
>>
>>HTH,
>>oliver
> 
> 
> 
> hi oliver, 
> 
> I already tried that method "default_catalog" (defined in the 'CatalogAware' class) but it returns "Catalog" which can't be right, because 'myobj' is cataloged in a ZCatalog called "MyCatalog".
> 

We are talking about a filesystem based product here which mixes in 
CatalogAware?
I find it hard to believe that what you describe is possible, because 
CatalogAware's index_object() method uses the value of default_catalog 
to find the Catalog instance to index in.

Maybe provide more specifics.

cheers,
oliver