问题:

原始的链接为

http://127.0.0.1:8000/article/list-article-titles-bysomeone/guchen/?column=django

有一个column参数,单击下一页时,链接会变成

http://127.0.0.1:8000/article/list-article-titles-bysomeone/guchen/?page=2

会将column参数丢失,导致单击下一页时会显示成所有的对象的分页

<div class="pagination">
    <span class="step-links">
        {% if page.has_previous %}
            <a href="?page={{ page.previous_page_number }}">上一页</a>
        {% endif %}

        <span class="current">
            Page{{ page.number }} of {{ page.paginator.num_pages }}
        </span>

        {% if page.has_next %}
            <a href="?page={{ page.next_page_number }}">下一页</a>
        {% endif %}
    </span>
</div>

解决方案:

https://my.oschina.net/esdn/blog/836101

https://www.cnblogs.com/lgh344902118/p/6855683.html

https://blog.csdn.net/weixin_41812940/article/details/82707372

 

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-07-11
  • 2021-10-16
  • 2022-12-23
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-12-18
  • 2021-06-11
  • 2022-12-23
相关资源
相似解决方案