[Zope-CMF] Does portal_catalog have a getobject method ?

Kent Polk kent@goathill.org
26 Jun 2001 17:13:54 GMT


On 25 Jun 2001 04:25:00 -0500, Chris Withers wrote:
> Kent Polk wrote:
>> 
>> The reason I thought it ought to be portal_catalog.getobject() was
>> to take advantage of the cmf security wrapping provided by
>> CMFCore/interfaces/portal_catalog.py
>> 
>> Do the brains provide for this in the same way?
> 
> The security wrapping happens before this stage, so yes, the brains have the
> same effect. Although you may want to clairfy what the desired effect is...

But why not have a consistent, easily discovered interface?

portal_catalog already has:

 searchResults
 __call__
 indexObject
 unindexObject
 reindexObject
 getpath

All which inherit security assertions from ZCatalog.

Zope is muddled enough with hard-to-discover mechanisms. Why not
add four little lines to make life easier by making this more
discoverable and consistent?

    # getobject inherits security assertions from ZCatalog.
    def getobject(self, data_record_id_):
        '''Calls ZCatalog.getobject().
        '''