学习Flask之分页插件flask_bootstrap
{# This file was part of Flask-Bootstrap and was modified under the terms of
its BSD License. Copyright (c) 2013, Marc Brinkmann. All rights reserved. #}
{% macro render_pager(pagination,
fragment='',
prev=('←
Previous')|safe,
next=('Next →
')|safe,
align='') -%}
{%- endmacro %}
{% macro _arg_url_for(endpoint, base) %}
{# calls url_for() with a given endpoint and **base as the parameters,
【学习Flask之分页插件flask_bootstrap】additionally passing on all keyword_arguments (may overwrite existing ones)
#}
{%- with kargs = base.copy() -%}
{%- do kargs.update(kwargs) -%}
{{ url_for(endpoint, **kargs) }}
{%- endwith %}
{%- endmacro %}
{% macro render_pagination(pagination,
endpoint=None,
prev=('«
')|safe,
next=('»
')|safe,
size=None,
ellipses='…',
args={},
fragment='',
align=''
)-%}
{% if fragment != '' and not fragment.startswith('#') %}{% set fragment = '#' + fragment %}{% endif %}
{% with url_args = {} %}
{%- do url_args.update(request.view_args if not endpoint else {}),
url_args.update(request.args if not endpoint else {}),
url_args.update(args) -%}
{% with endpoint = endpoint or request.endpoint %}
{% endwith %}
{% endwith %}
{% endmacro %}
推荐阅读
- PMSJ寻平面设计师之现代(Hyundai)
- 太平之莲
- 闲杂“细雨”
- 七年之痒之后
- 深入理解Go之generate
- 由浅入深理解AOP
- 期刊|期刊 | 国内核心期刊之(北大核心)
- 生活随笔|好天气下的意外之喜
- 感恩之旅第75天
- 继续努力,自主学习家庭Day135(20181015)