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

Oliver Bleutgen myzope@gmx.net
Fri, 06 Jun 2003 12:02:25 +0200


Nico Grubert wrote:
> Hi there,
> 
> I have a catalog aware object "myobj" in the ZODB which is cataloged in a ZCatalog "MyCatatlog". Is there a way to get the ZCatalog in which myobj is cataloged if I have the myobj object ?

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