summaryrefslogtreecommitdiffstats
path: root/utils/pagination.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-10 05:08:36 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-10 05:08:36 +0100
commit1ec270de4390f215f874e8fad23736ce978c1bbd (patch)
treef56ebd30ec7648f785b558e499148d424bc55147 /utils/pagination.py
parent915c05c05a5b510d53042944582dc62c7d3f28d1 (diff)
downloadpadlite-teams-1ec270de4390f215f874e8fad23736ce978c1bbd.tar.gz
padlite-teams-1ec270de4390f215f874e8fad23736ce978c1bbd.tar.bz2
padlite-teams-1ec270de4390f215f874e8fad23736ce978c1bbd.zip
Use sqlalchemy, flask-migrate, flask-login and flask-script
No peewee anymore. All dependencies are available as debian packages now.
Diffstat (limited to 'utils/pagination.py')
-rw-r--r--utils/pagination.py18
1 files changed, 18 insertions, 0 deletions
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)