From 1ec270de4390f215f874e8fad23736ce978c1bbd Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 10 Jan 2016 05:08:36 +0100 Subject: Use sqlalchemy, flask-migrate, flask-login and flask-script No peewee anymore. All dependencies are available as debian packages now. --- utils/pagination.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 utils/pagination.py (limited to 'utils/pagination.py') diff --git a/utils/pagination.py b/utils/pagination.py new file mode 100644 index 0000000..8d2cb60 --- /dev/null +++ b/utils/pagination.py @@ -0,0 +1,18 @@ +from flask import url_for, request +from app import app + + +def url_for_other_page(page): + args = request.view_args.copy() + args['page'] = page + return url_for(request.endpoint, **args) +app.jinja_env.globals['url_for_other_page'] = url_for_other_page + + +# @app.context_processor +# def register_method(): +# def url_for_other_page(page): +# args = request.view_args.copy() +# args['page'] = page +# return url_for(request.endpoint, **args) +# return dict(url_for_other_page=url_for_other_page) -- cgit v1.2.3-1-g7c22