[web/views] if view has attribute paginable=False, do not try to paginate it stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 07 Jan 2010 17:41:50 +0100
branchstable
changeset 4213 d4eeaf0393e2
parent 4212 ab6573088b4a
child 4214 91887e8cf50c
[web/views] if view has attribute paginable=False, do not try to paginate it
web/views/navigation.py
--- a/web/views/navigation.py	Thu Jan 07 16:52:32 2010 +0100
+++ b/web/views/navigation.py	Thu Jan 07 17:41:50 2010 +0100
@@ -175,9 +175,10 @@
 def paginate(view, show_all_option=True, w=None, page_size=None, rset=None):
     if rset is None:
         rset = view.rset
-    limit_rset_using_paged_nav(view, view.req, rset, w or view.w,
-                               not view.need_navigation, show_all_option,
-                               page_size=page_size)
+    if getattr(view, 'paginable', True):
+        limit_rset_using_paged_nav(view, view.req, rset, w or view.w,
+                                   not view.need_navigation, show_all_option,
+                                   page_size=page_size)
 View.paginate = paginate
 
 class NextPrevNavigationComponent(EntityVComponent):