[Zope-dev] Question about using CatalogAware
Kevin Dangoor
kid@kendermedia.com
Wed, 4 Aug 1999 18:54:15 -0400
-----Original Message-----
From: Anthony Baxter <anthony@interlink.com.au>
To: Kevin Dangoor <kid@kendermedia.com>
Cc: zope-dev@zope.org <zope-dev@zope.org>
Date: Wednesday, August 04, 1999 6:48 PM
Subject: Re: [Zope-dev] Question about using CatalogAware
>>>> "Kevin Dangoor" wrote
>> A test DTML Method showed me that default_catalog = 'Catalog'. I have a
>> ZCatalog called 'Catalog' in the Zope root. Since the ZClass is an Object
>> Manager, the Method is one level down and will have to acquire the
catalog.
>>
>> If I replace "_[default_catalog](searchfor)" with "Catalog(searchfor)",
the
>> method works.
>
>what about "_[_[default_catalog]](searchfor)" ?
>
>If I understand your mail correctly, default_catalog is set to the _string_
>'Catalog' - you need to look up the value of the string to get the
object...
That's why I thought that my syntax was correct... _[default_catalog] should
look up 'Catalog' in the namespace. If I had said
_['default_catalog'], that would've returned 'Catalog'.
_[_[default_catalog]] actually tries to use the catalog object itself as a
key in the namespace (and yields a "bad argument to internal function"
error).
Kevin