[ZCM] [ZC] 753/ 1 Request "inconsistencies in the way to detect a missing attribute"
Collector: Zope Bugs, Features, and Patches ...
zope-coders-admin@zope.org
Thu, 02 Jan 2003 06:35:17 -0500
Issue #753 Update (Request) "inconsistencies in the way to detect a missing attribute"
Status Pending, Catalog/bug medium
To followup, visit:
http://collector.zope.org/Zope/753
==============================================================
= Request - Entry #1 by olivluca on Jan 2, 2003 6:35 am
When catalogging/metadataing objects the catalog and plugin indexes try to detect a missing attribute in order to avoid indexing or storing metadata for a non existing attribute.
The problem is that each plugin index and the metadata extraction use different methods:
1) metadata (see recordify in Catalog.py) uses MV from Missing to indicate a missing attribute
2) UnIndex (and all indexes derived from it) uses an private attribute _marker defined as []
3) KeywordIndex uses () as a missing attribute and just catalogs everything
The problem is that if the attribute is provided by (e.g.) a python script, it's impossible for the python script to indicate a missing attribute, or it has to be done in several different methods:
a) for metadata is possible to return MV from Missing to indicate a missing attribute
b) for indexes deriving from UnIndex is impossible to indicate a missing attribute (since _marker is private)
c) for keyword indexes one has to return ()
d) even if it was possible to import the private _merker, it's not the same _marker for each index.
I think the solution would be to use the same value everywhere to detect a missing attribute, and this value should be useable from external method, like, e.g., MV from Missing, or a non private attribute imported from the same module.
==============================================================