blob: 8d2cb600e8fb784de0156cdc576c5a78381818e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
|