diff --git lib/python2.4/site-packages/roundup/cgi/ZTUtils/Batch.py lib/python2.4/site-packages/roundup/cgi/ZTUtils/Batch.py index 66dde68..79d8d7d 100644 --- lib/python2.4/site-packages/roundup/cgi/ZTUtils/Batch.py +++ lib/python2.4/site-packages/roundup/cgi/ZTUtils/Batch.py @@ -67,8 +67,7 @@ class Batch: start,end,sz = opt(start,end,size,orphan,sequence) self._sequence = sequence - self.size = sz - self._size = size + self.size = size self.start = start self.end = end self.orphan = orphan @@ -92,7 +91,9 @@ class Batch: def opt(start,end,size,orphan,sequence): if size < 1: - if start > 0 and end > 0 and end >= start: + if size == 0: + size=len(sequence) + elif start > 0 and end > 0 and end >= start: size=end+1-start else: size=7 diff --git lib/python2.4/site-packages/roundup/cgi/templating.py lib/python2.4/site-packages/roundup/cgi/templating.py index deacc88..e839321 100644 --- lib/python2.4/site-packages/roundup/cgi/templating.py +++ lib/python2.4/site-packages/roundup/cgi/templating.py @@ -2812,8 +2812,11 @@ class Batch(ZTUtils.Batch): def previous(self): if self.start == 1: return None - return Batch(self.client, self._sequence, self._size, - self.first - self._size + self.overlap, 0, self.orphan, + if self.size == 0: + return Batch(self.client, self._sequence, self.size, + 0, 0, self.orphan, self.overlap) + return Batch(self.client, self._sequence, self.size, + self.first - self.size + self.overlap, 0, self.orphan, self.overlap) def next(self): @@ -2821,7 +2824,7 @@ class Batch(ZTUtils.Batch): self._sequence[self.end] except IndexError: return None - return Batch(self.client, self._sequence, self._size, + return Batch(self.client, self._sequence, self.size, self.end - self.overlap, 0, self.orphan, self.overlap) class TemplatingUtils: