[ZCM] [ZC] 2146/ 1 Request "catalog calls subobjects named like indexable attributes"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Jul 10 11:39:35 EDT 2006


Issue #2146 Update (Request) "catalog calls subobjects named like indexable attributes"
 Status Pending, Catalog/bug+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/2146

==============================================================
= Request - Entry #1 by frisi on Jul 10, 2006 11:39 am

catalog tries to index start which should be a date.
in fact our folder does not have a start field, but a subobject with the id "start".
the catalog tries to call all indexable attributes in ZCatalog.Catalog.recordify:
in our case folder.start() which renders the html representation of the object.


either the index should treat wrong parameters as missing values or zcatalog should be able to see the difference between start as an ordinary attribute or method and a callable subobject start:


    indexed attributes and methods
    >>> self.names
    ('Subject', 'Title', 'Description', 'Type', 'review_state', 'Creator', 'listCreators', 'Date', 'getIcon', 'created', 'effective', 'expires', 'modified', 'CreationDate', 'EffectiveDate', 'ExpirationDate', 'ModificationDate', 'getId', 'portal_type', 'id', 'getObjSize', 'exclude_from_nav', 'meta_type', 'location', 'getRemoteUrl', 'start', 'end', 'is_folderish')

    getId is a method and callable
    >>> type(getattr(object, 'getId', MV))
    <type 'instancemethod'>
    >>> safe_callable(getattr(object, 'getId', MV))
    1

    title is a plain unicode string
    >>> type(getattr(object, 'title', MV))
    <type 'unicode'>
    >>> safe_callable(getattr(object, 'title', MV))
    0

    although start is callable it should not be called, because
    it is no instancemethod
    >>> safe_callable(getattr(object, 'start', MV))
    1
    >>> type(getattr(object, 'start', MV))
    <type 'ImplicitAcquirerWrapper'>

i don't know is be the best way to find out if we are going to index a zope object. maybe a test for type ``ImplicitAcquirerWrapper`` would do it...
==============================================================



More information about the Zope-Collector-Monitor mailing list