使用了 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) }}
|  |      1nowbear      2016-05-29 10:59:02 +08:00 via Android 感谢分享 | 
|  |      2Akarin      2016-05-29 12:29:52 +08:00 亮点在那里? | 
|  |      3ibigbug      2016-05-29 14:58:43 +08:00 每页展示 38 条怎么办? | 
|  |      6ibigbug      2016-05-30 12:19:47 +08:00  1 要重新部署? | 
|  |      7honmaple OP  1 改一下就行,用不了几分钟,使用 PER_PAGE 的话以后容易修改,你也可以直接 topics = Topic.query.paginate(page,38,error_out=True) | 
|  |      8ibigbug      2016-05-31 20:22:19 +08:00 应该写到 querystring 由用户传进来 | 
|  |      10ibigbug      2016-06-02 00:28:44 +08:00 `def pager(page=1, per_page=10):` |