Source code for ps_alchemy.paginator

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 uralbash <root@uralbash.ru>
#
# Distributed under terms of the MIT license.

"""
Webhelpers paginator
"""
from paginate import Page, make_html_tag





[docs]def get_current_page(request): return int(request.params.get('page', 1))
[docs]def get_paginator(request, items_per_page=10): return { "items_per_page": items_per_page, "page": get_current_page(request), "url_maker": lambda p: request.path_url + "?page=%s" % p, "link_tag": paginate_link_tag }
  Read the Docs
v: latest  
Versions
latest
stable
Free document hosting provided by Read the Docs.