Commit 48249b5d authored by Andreas Jung's avatar Andreas Jung

fixes for _length

parent 054cc497
...@@ -25,6 +25,7 @@ from OFS.SimpleItem import SimpleItem ...@@ -25,6 +25,7 @@ from OFS.SimpleItem import SimpleItem
from BTrees.IOBTree import IOBTree from BTrees.IOBTree import IOBTree
from BTrees.IIBTree import IISet, IITreeSet, union, intersection, multiunion from BTrees.IIBTree import IISet, IITreeSet, union, intersection, multiunion
import BTrees.Length
from Globals import package_home, DTMLFile, InitializeClass from Globals import package_home, DTMLFile, InitializeClass
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
...@@ -136,7 +137,7 @@ class DateRangeIndex(UnIndex): ...@@ -136,7 +137,7 @@ class DateRangeIndex(UnIndex):
self._since = IOBTree() self._since = IOBTree()
self._until = IOBTree() self._until = IOBTree()
self._unindex = IOBTree() # 'datum' will be a tuple of date ints self._unindex = IOBTree() # 'datum' will be a tuple of date ints
self._length.set(0) self._length = BTrees.Length.Length()
# #
# PluggableIndexInterface implementation (XXX inherit assertions?) # PluggableIndexInterface implementation (XXX inherit assertions?)
......
...@@ -99,6 +99,7 @@ class UnIndex(SimpleItem): ...@@ -99,6 +99,7 @@ class UnIndex(SimpleItem):
def clear(self): def clear(self):
self._index = OOBTree() self._index = OOBTree()
self._unindex = IOBTree() self._unindex = IOBTree()
self._length.set(0)
def __nonzero__(self): def __nonzero__(self):
return not not self._unindex return not not self._unindex
...@@ -203,7 +204,7 @@ class UnIndex(SimpleItem): ...@@ -203,7 +204,7 @@ class UnIndex(SimpleItem):
returnStatus = 0 returnStatus = 0
# First we need to see if there's anything interesting to look at # First we need to see if there's anything interesting to look at
datum = self._get_object_datum(obj, attr) datum = self._get_object_datum(obj, attr)
# We don't want to do anything that we don't have to here, so we'll # We don't want to do anything that we don't have to here, so we'll
# check to see if the new and existing information is the same. # check to see if the new and existing information is the same.
......
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