Fix index computation to select ids in BrowseRecord

review48001
This commit is contained in:
Cédric Krier committed 2011-06-22 20:49:32 +02:00
1 parent 881d74623a
commit b0611ac784
1 file changed
+3 -2
+3 -2
View File
@@ -157,8 +157,9 @@ class BrowseRecord(object):
return False
return True
index = self._ids.index(self.id)
ids = list(islice(ifilter(filter_, chain(self._ids, self._ids)),
index, self._cursor.IN_MAX + index))
ids = chain(islice(self._ids, index, None),
islice(self._ids, 0, max(index - 1, 0)))
ids = list(islice(ifilter(filter_, ids), self._cursor.IN_MAX))
model2ids = {}
model2cache = {}
# read the data