[Zope] Zclasses derived from ZCatalog

Tom Schwaller Tom.Schwaller@linux-magazin.de
Wed, 03 Nov 1999 09:31:15 +0000


Tres Seaver wrote:
> 
> Tom Schwaller <tom.schwaller@linux-magazin.de> wrote:
> 
> > http://www.zope.org/Members/Zen/tips/tip_ZCatalogInZClass
> >
> > shows nicely how to add a ZCatalog in a ContainerClass.
> > How does one implement the same functionality
> > when deriving a class A from ZCatalog:
> >
> > A(ZCatalog) -- B(CatalogAware)
> 
> Check out my How-To, http://www.zope.org/Members/tseaver/inherit_ZCatalog

cool, thanks a lot.
PARENTS[1].id is what I was looking for :-) (I forgot the .id)

> > How to modify
> > <dtml-with "Catalog">
> > <dtml-call "manage_addColumn('area',REQUEST,RESPONSE,URL1)"> ?
> 
> Just call the method (of the ZCatalog-derived class):
> 
>  <dtml-call "manage_addColumn( 'area', REQUEST, RESPONSE, URL1 )">

ok, I'll try that...

> > <dtml-with _catalog>
> > will not work.
> 
> Right, attributes/methods starting with "_" are invisible to DTML.

> I like deriving from ZCatalog, so the users do not see
> the Catalog (otherwise one could delete it) and the 
> ContainerClass (Books) is the catalog of its members (Book).
>
> Any hints?

> This is essentially what I am doing -- I just tried adding a DTMLMethod named
> "Catalog" to the ZCatalog-derived class, which just returns this() -- IT WORKS!

Could you explain that with code? I'm not exactly shure hoh you do that.

With that you do not need 

<dtml-call "manage_editCataloger( PARENTS[1].id, REQUEST )">

anymore. Is that right? You should ad this very cool trick
to your howto (this will be my number 1. Zope magic Trick for this week
:-))

-- 

Tom