[Checkins] SVN: Products.ZCatalog/trunk/ Revert premature c121454 (acquisition of attributes)

Hanno Schlichting hannosch at hannosch.eu
Thu Apr 21 15:35:24 EDT 2011


Log message for revision 121461:
  Revert premature c121454 (acquisition of attributes)
  

Changed:
  U   Products.ZCatalog/trunk/CHANGES.txt
  U   Products.ZCatalog/trunk/src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
  U   Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py

-=-
Modified: Products.ZCatalog/trunk/CHANGES.txt
===================================================================
--- Products.ZCatalog/trunk/CHANGES.txt	2011-04-21 18:24:31 UTC (rev 121460)
+++ Products.ZCatalog/trunk/CHANGES.txt	2011-04-21 19:35:24 UTC (rev 121461)
@@ -11,8 +11,6 @@
 - Handle `TypeErrors` in the KeywordIndex if an indexed attribute is a method
   with required arguments.
 
-- Protect against implicitly acquiring attributes for indexes.
-
 - Added reporting of the intersection time of each index' result with the
   result set of the other indexes and consider this time to be part of each
   index time for prioritizing the index.

Modified: Products.ZCatalog/trunk/src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py	2011-04-21 18:24:31 UTC (rev 121460)
+++ Products.ZCatalog/trunk/src/Products/PluginIndexes/KeywordIndex/KeywordIndex.py	2011-04-21 19:35:24 UTC (rev 121461)
@@ -15,15 +15,13 @@
 
 from logging import getLogger
 
-from Acquisition import aq_base
-from App.special_dtml import DTMLFile
 from BTrees.OOBTree import difference
 from BTrees.OOBTree import OOSet
+from App.special_dtml import DTMLFile
 
 from Products.PluginIndexes.common import safe_callable
 from Products.PluginIndexes.common.UnIndex import UnIndex
 
-_marker = []
 LOG = getLogger('Zope.KeywordIndex')
 
 
@@ -92,9 +90,6 @@
         return 1
 
     def _get_object_keywords(self, obj, attr):
-        has_attr = getattr(aq_base(obj), attr, _marker)
-        if has_attr is _marker:
-            return ()
         newKeywords = getattr(obj, attr, ())
         if safe_callable(newKeywords):
             try:

Modified: Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py	2011-04-21 18:24:31 UTC (rev 121460)
+++ Products.ZCatalog/trunk/src/Products/PluginIndexes/common/UnIndex.py	2011-04-21 19:35:24 UTC (rev 121461)
@@ -17,7 +17,6 @@
 from logging import getLogger
 import sys
 
-from Acquisition import aq_base
 from BTrees.IIBTree import intersection
 from BTrees.IIBTree import IITreeSet
 from BTrees.IIBTree import IISet
@@ -265,9 +264,6 @@
         # self.id is the name of the index, which is also the name of the
         # attribute we're interested in.  If the attribute is callable,
         # we'll do so.
-        has_attr = getattr(aq_base(obj), attr, _marker)
-        if has_attr is _marker:
-            return _marker
         try:
             datum = getattr(obj, attr)
             if safe_callable(datum):



More information about the checkins mailing list