[Zope-Checkins] CVS: Products/ZCatalog - ZCatalog.py:1.123

Shane Hathaway shane@zope.com
Fri, 17 Jan 2003 23:17:23 -0500


Update of /cvs-repository/Products/ZCatalog
In directory cvs.zope.org:/tmp/cvs-serv9917

Modified Files:
	ZCatalog.py 
Log Message:
Merge from 2_6 branch: fixed stored acquisition wrappers.

Some indexes were storing acquisition wrappers in the cyclic references
back to the ZCatalog instance.  Removed the acquisition wrappers and
cleaned up a bad use of apply().  The acquisition wrappers were revealed
by AdaptableStorage.

There's a second problem, in that indexes are unknowingly storing references
back to the ZCatalog in an unused attribute.  In the 2_6 branch it's
hard to fix without breaking things, but on the HEAD there's a better way
to fix this.  Coming soon, I hope.


=== Products/ZCatalog/ZCatalog.py 1.122 => 1.123 ===
--- Products/ZCatalog/ZCatalog.py:1.122	Thu Dec  5 16:17:05 2002
+++ Products/ZCatalog/ZCatalog.py	Fri Jan 17 23:17:21 2003
@@ -19,7 +19,7 @@
 from OFS.FindSupport import FindSupport
 from OFS.ObjectManager import ObjectManager
 from DateTime import DateTime
-from Acquisition import Implicit
+from Acquisition import Implicit, aq_base
 from Persistence import Persistent
 from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
 from DocumentTemplate.DT_Util import Eval
@@ -913,9 +913,9 @@
         # for new index types is to use an "extra" record.
 
         if 'extra' in base.__init__.func_code.co_varnames:
-            index = apply(base,(name,), {"extra":extra,"caller":self})
+            index = base(name, extra=extra, caller=aq_base(self))
         else:
-            index = base(name,self)
+            index = base(name, aq_base(self))
 
         self._catalog.addIndex(name,index)