app/soc/views/helper/lists.py
changeset 723 69e5130e4a0a
parent 651 ef6e22d463cb
child 1165 4db62684ce13
--- a/app/soc/views/helper/lists.py	Fri Dec 12 00:34:39 2008 +0000
+++ b/app/soc/views/helper/lists.py	Fri Dec 12 00:35:08 2008 +0000
@@ -23,6 +23,8 @@
   ]
 
 
+import itertools
+
 from soc.logic import dicts
 
 import soc.views.helper.forms
@@ -125,12 +127,14 @@
   if not filter:
     data = logic.getForLimitAndOffset(limit+1, offset=offset)
   else:
-    data = logic.getForFields(filter, limit=limit+1, offset=offset)
+    data = logic.getForFields(filter)
 
   if not data:
     data = []
 
-  more = bool(data[limit:])
+  data = list(itertools.islice(data, limit+1))
+
+  more = len(data) > limit
   if more:
     del data[limit:]