[Zope-dev] CatalogAwareness?

Michel Pelletier michel@digicool.com
Fri, 30 Jul 1999 22:34:16 -0400


David Kankiewicz wrote:
> 
> Working with the current CVS checkout...
> 
> CatalogAwareness.py:
> I saw this file added over the last few days and tried to test the
> "editCatalogerForm", more like played around with it.  Having tried a few
> different zclasses subclassed CatalogAware, with no luck, I wondered if you
> could explain or hint how you intend it to behave and if its working yet?
> (any guess when it will be working?)
> 

If a ZClass subclasses CatalogAware, and there is a 'Catalog' object in
it's acquisition path, they the object will automaticly catalog and
uncatalog itself when it is instanciated/deleted.

Note that there is a serious bug in the existing CatalogAware class that
will cripple you.  I would wait until Beta2 or track the CVS (I just
checked in the fix), or if your bold, go into the CatalogAware class
definition and completely delete the:

def aq_base(...

method.  It's inclusion was a mistake.

> Permission mapping for ZClasses seems to be Showing the Non-Inherited
> permissions and not Showing the Inherited permissions.. just letting you
> know its not working..
> 

I'll look into it.

> Suggestion for editCatalogForm....
> I was trying to get "editCatalogForm" to list available Catalogs (that what
> be better then Typing a name of a Catalog, especially if you don't know the
> name), but I'm too new to python and Zope to get it to work.  That brings
> up, does each ZCatalog create a new Catalog and what would that name be??
> 

It's up to you to name your Catalogs whatever you want.  CatalogAware
assumes 'Catalog'.  Amos pointed out that this is a bit silly, cuz when
you change the id of your Catalog, you'd have to change all the
instances too.  So beta 2 will probably first try to acquire a property
which contains the name of the Catalog you want all CatalogAware objects
to catalog themselves with.

-Michel