get custom page_size as argument
authorArthur Lutz <arthur.lutz@logilab.fr>
Tue, 10 Feb 2009 17:27:25 +0100
changeset 591 9eeb3d0a4463
parent 590 bbf6d47a2e9b
child 592 aae01d81c713
get custom page_size as argument
common/selectors.py
--- a/common/selectors.py	Tue Feb 10 17:27:05 2009 +0100
+++ b/common/selectors.py	Tue Feb 10 17:27:25 2009 +0100
@@ -161,13 +161,16 @@
 def paginated_rset(cls, req, rset, *args, **kwargs):
     """accept result sets with more rows than the page size
     """
-    if rset is None or len(rset) <= req.property_value('navigation.page-size'):
+    page_size = kwargs.get('page_size')
+    if page_size is None:
+        page_size = req.property_value('navigation.page-size')
+    if rset is None or len(rset) <= page_size:
         return 0
     return 1
 largerset_selector = deprecated_function(paginated_rset)
 
 @lltrace
-def sorted_rset(cls, req, rset, row=None, col=None):
+def sorted_rset(cls, req, rset, row=None, col=None, **kwargs):
     """accept sorted result set"""
     rqlst = rset.syntax_tree()
     if len(rqlst.children) > 1 or not rqlst.children[0].orderby: