[Zope-dev] "ZCatalog-aware ZClasses"

Michel Pelletier michel@digicool.com
Fri, 2 Jul 1999 13:57:52 -0400


> -----Original Message-----
> From: Anthony Baxter [mailto:anthony@interlink.com.au]
> Sent: Friday, July 02, 1999 12:56 AM
> To: zope-dev@zope.org
> Subject: [Zope-dev] "ZCatalog-aware ZClasses"
> 
> 
> I saw this question asked, but didn't see an answer - what's a
> "ZCatalog-aware ZClass" involve? 
> 
> looking at the ZCatalog source, it looks like one way would be to
> make the code that adds the object instance search for a ZCatalog
> object, then call catalog.catalog_object(object, objecturl) - and
> the delete method should then call 
> catalog.uncatalog_object(objecturl).
> 

Exactly.  In most cases 'search for a ZCatalog' would just be
acquisition.

> Is it just a matter of making a single class that does just this, and
> make the ZClasses you build inherit from it? Or is there a 
> simpler way?

The easiest way we've found is to make a Z(Base)Class called 'Findable'
which impliments the adding, deleting, and findable attributes (which
you can override in (Sub)Zclasses).

How can it get any simpler than that?  I suppose it could cook breakfast
for you.  ;)

-Michel

> 
> Anthony
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
> 
> (For non-developer, user-level issues, use the companion list,
> zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
>