Commit 23927884 authored by Shane Hathaway's avatar Shane Hathaway

Reinstated the bugfix that prevents catalogs from accidentally storing

acquisition wrappers, but this time the bugfix is clearer.  The second
argument to an index constructor is usually not "caller"; it's usually
"ignore_ex", which gets stored as a meaningless attribute and ignored.

The bugfix builds upon the ugly code that's already there.  Ugly code
begets ugly code, unfortunately.
parent 8a390604
......@@ -907,15 +907,17 @@ class ZCatalog(Folder, Persistent, Implicit):
if base is None:
raise ValueError, "Index type %s does not support addIndex" % type
# This code is somewhat lame but every index type has its own
# This code is *really* lame but every index type has its own
# function signature *sigh* and there is no common way to pass
# additional parameters to the constructor. The suggested way
# for new index types is to use an "extra" record.
if 'extra' in base.__init__.func_code.co_varnames:
index = base(name, extra=extra, caller=self)
elif 'caller' in base.__init__.func_code.co_varnames:
index = base(name, caller=self)
else:
index = base(name, self)
index = base(name)
self._catalog.addIndex(name,index)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment