Code

issue2550678: Allow pagesize=-1 which returns all results.
authorber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 3 Sep 2011 20:12:51 +0000 (20:12 +0000)
committerber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 3 Sep 2011 20:12:51 +0000 (20:12 +0000)
  Suggested and implemented by John Kristensen.
  Tested by Satchidanand Haridas.

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4645 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/ZTUtils/Batch.py

index 2aac40e42bb37a032f60756b1152d9b28673a990..ac6e4456796ed9f3339d27110756e0726a4747e4 100644 (file)
@@ -6,6 +6,11 @@ Entries without name were done by Richard Jones.
 2011-XX-XX 1.4.20 (r4XXX)
 
 Features:
 2011-XX-XX 1.4.20 (r4XXX)
 
 Features:
+
+- issue2550678: Allow pagesize=-1 which returns all results.
+  Suggested and implemented by John Kristensen. 
+  Tested by Satchidanand Haridas. (Bernhard)
+
 Fixed:
 
 - issue2550715: IndexError when requesting non-existing file via http.
 Fixed:
 
 - issue2550715: IndexError when requesting non-existing file via http.
index 66dde6861ac3bd3a0606ce9d586bec39fa3ef1e1..0ee9738342b2016269895cc0145ce9492ffc6557 100644 (file)
@@ -52,7 +52,8 @@ class Batch:
         "orphan" elements, it is combined with the current batch.
         "overlap" is the number of elements shared by adjacent
         batches.  If "size" is not specified, it is computed from
         "orphan" elements, it is combined with the current batch.
         "overlap" is the number of elements shared by adjacent
         batches.  If "size" is not specified, it is computed from
-        "start" and "end".  Failing that, it is 7.
+        "start" and "end".  If "size" is 0, it is the length of
+        the sequence. Failing that, it is 7.
 
         Attributes: Note that the "start" attribute, unlike the
         argument, is a 1-based index (I know, lame).  "first" is the
 
         Attributes: Note that the "start" attribute, unlike the
         argument, is a 1-based index (I know, lame).  "first" is the
@@ -92,7 +93,9 @@ class Batch:
 
 def opt(start,end,size,orphan,sequence):
     if size < 1:
 
 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
 
             size=end+1-start
         else: size=7