使用了 bootstrap 的分页 class ,具体看gist
topics = Topic.query.paginate(page,app.config['PER_PAGE'],error_out=True)
{% from 'paginate.html' import paginate %}
{{ paginate(topics,'topic.topic') }}
如果含参数
{{ paginate(topics,'topic.topic',dict(tag=tag) }}
1
nowbear 2016 年 5 月 29 日 via Android
感谢分享
|
2
Akarin 2016 年 5 月 29 日
亮点在那里?
|
3
ibigbug 2016 年 5 月 29 日
每页展示 38 条怎么办?
|
6
ibigbug 2016 年 5 月 30 日 要重新部署?
|
7
honmaple OP 改一下就行,用不了几分钟,使用 PER_PAGE 的话以后容易修改,你也可以直接
topics = Topic.query.paginate(page,38,error_out=True) |
8
ibigbug 2016 年 5 月 31 日
应该写到 querystring 由用户传进来
|
10
ibigbug 2016 年 6 月 2 日
`def pager(page=1, per_page=10):`
|