[Zope] Zclasses derived from ZCatalog

Tres Seaver tseaver@palladion.com
Wed, 03 Nov 1999 09:31:06 -0600


Martijn Pieters wrote:
> 
> 
> >CAVEAT:
> >
> >I haven't yet figured out how to use the Catalog-method inside other DTML,
> >e.g.,
> >
> >   <dtml-in "Catalog( meta_type='BarBaz' )">
> >     ...
> >   </dtml-in>
> >
> >doesn't work.  I'll think on it some more.
> 
>    <dtml-in "_['Catalog'](meta_type='BarBaz')">
> 
> will work, but not with a real Catalog object, only your DTML trickery.

Hmm, I can't seem to make that work:

  ZClass Foo( ObjectManager, ZCatalog )
  \
   ZClass Bar( CatalogAware, ObjectManager )
   \
    ZClass Baz( CatalogAware )

I can add Bars and Bazzes within a Foo, and they show up in its
manage_catalogView.  I tried defining a DTML method using your syntax in either
Foo or Bar to (say) list all the Bazzes, like so:

  <dtml-var standard_html_header>

  <UL>
    <dtml-in "_['Catalog'](meta_type='Baz')">
      <LI> <dtml-var id>
    </dtml-in>
  </UL>

  <dtml-var standard_html_footer>

But I can't execute it -- I get "You are not authorized to access Catalog".  If
I tweak the permission map a bit for Foo (Access Content Information->Access
Content Information), I then get "You are not authorized to access this".  

So, I give the Catalog method a "Manager" proxy.  Now, I get:

  Error Type: AttributeError
  Error Value: __getitem__

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com