我正在尝试使用peewee模型对Flask应用中的结果进行分页,但是我无法显示循环中的价值
app.py
@app.route('/log/')
def log():
asd = loguser.select().join(user).order_by(loguser.id.desc())
return object_list( 'log.html',
query=asd,
context_variable='post_list',
paginate_by=10)
log.html
{% extends 'basic.html' %}
{% block content %}
{% for data in object_list %}
<p>{{data.id}}</p>
{% endfor %}
{% include "includes/pagination.html" %}
{% endblock %}
pagination.html
{% if pagination.get_page_count() > 1 %}
<ul class="pager">
{% if pagination.get_page() > 1 %}
<li class="previous"><a href="./?{{ request.args|clean_querystring('page', page=pagination.get_page() - 1) }}">« Previous {{ pagination.get_page() - 1 }} / {{ pagination.get_page_count() }}</a></li>
{% else %}
<li class="previous disabled"><a href="#">« Previous</a></li>
{% endif %}
{% if pagination.get_page_count() > pagination.get_page() %}
<li class="next"><a href="./?{{ request.args|clean_querystring('page', page=pagination.get_page() + 1) }}">Next {{ pagination.get_page() + 1 }} / {{ pagination.get_page_count() }} »</a></li>
{% else %}
<li class="next disabled"><a href="#">Next »</a></li>
{% endif %}
</ul>
{% endif %}
我希望输出的是一些数据,我可以移到另一页