[Zope-dev] CatalogAware

Michael Bernstein webmaven@lvcm.com
Thu, 04 Jan 2001 21:58:43 -0800


Erik Enge wrote:
> 
> [Michael Bernstein]
> 
> | When called, they find the nearest (acquisition-wise) ZCatalog
> | (named Catalog by default),
> 
> I think you can specify the ZCatalog it should index itself in by
> putting the default_catalog attribute in your class.

Your example is correct as far as it goes, but as I
understand it, you are not really specifying the default
catalog per se, but the default catalog *name*. Therefore,
it will then look for the nearest catalog of the name that
you have redefined as the default.

So if you redefine it to be ZCatalog1, and you have the
following structure:

/
|-/Catalog
|
|-/ZCatalog1
|
|-/folder1
|  |
|  |-/folder1/ZCatalog1
|
|-/folder2

Assuming a CatalogAware ZClass has had it's default_catalog
defined to be 'ZCatalog1', and that an instance of this
ZClass is then added in /folder2, it will index itself in
/ZCatalog1, whereas an instance that is added in /folder1
will index itself in /folder1/ZCatalog1.

This is my current understanding, I apologise if what I've
said is incorrect.

HTH,

Michael Beernstein.