web/views/navigation.py
changeset 4283 b3c40ae2d045
parent 4265 0912f111b028
child 4335 1314772c1183
equal deleted inserted replaced
4282:149b33d22d87 4283:b3c40ae2d045
   220 
   220 
   221 def paginate(view, show_all_option=True, w=None, page_size=None, rset=None):
   221 def paginate(view, show_all_option=True, w=None, page_size=None, rset=None):
   222     """paginate results if the view is paginable and we're not explictly told to
   222     """paginate results if the view is paginable and we're not explictly told to
   223     display everything (by setting __force_display in req.form)
   223     display everything (by setting __force_display in req.form)
   224     """
   224     """
   225     if not (view.paginable or view.req.form.get('__force_display')):
   225     if not (view.paginable or view._cw.form.get('__force_display')):
   226         do_paginate(view, rset, w or view.w, show_all_option, page_size)
   226         do_paginate(view, rset, w or view.w, show_all_option, page_size)
   227 
   227 
   228 # monkey patch base View class to add a .paginate([...])
   228 # monkey patch base View class to add a .paginate([...])
   229 # method to be called to write pages index in the view and then limit the result
   229 # method to be called to write pages index in the view and then limit the result
   230 # set to the current page
   230 # set to the current page