【问题标题】:How to Paginate with Django Postman如何使用 Django Postman 进行分页
【发布时间】:2018-09-11 00:18:57
【问题描述】:

我对 Django 有点陌生,我正在做一个需要用户到用户消息传递的项目,所以我决定使用 Django postman。我能够安装在我的项目文件夹中,但我面临的问题与分页有关。收件箱应在 20 条消息后分页,但不会。

base_folder.html

<p>

    <div id="postman">
    <h1>{% block pm_folder_title %}{% endblock %}</h1>
    {% autopaginate pm_messages %}
    {% if invalid_page %}
    <p>{% trans "Sorry, this page number is invalid." %}</p>
    {% else %}
    {% if pm_messages %}
    {% b

lock pm_by_modes %}<div id="pm_byModes">

</p>

真的需要帮助

【问题讨论】:

    标签: django web


    【解决方案1】:

    根据FAQ in django-postman docs

    我安装了 django-pagination,但我仍然没有看到任何分页小部件

    Is there really more messages than one page capacity (default is 20)?
    Check that pagination is declared before postman in the INSTALLED_APPS setting.
    See if it’s better by disabling postman/templatetags/pagination_tags.py and .pyc (rename or move the files).
    

    【讨论】:

    • 我在收件箱中有 23 封邮件,所以它应该已经使用了分页
    • 如果我不使用像 dj_pagination 这样的外部分页应用程序,我还需要在设置中包含“分页”吗?
    猜你喜欢
    • 1970-01-01
    • 2018-12-25
    • 1970-01-01
    • 2010-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-28
    相关资源
    最近更新 更多