如果我包含paginator
,那么它在同一页面上打印多个paginator
。因为我包括在forloop
。我该如何解决这个问题?请帮忙获取多个分页符
----------------------
{% autopaginate recipes %}
{% for recipe in recipes %}
{{ forloop.counter }}
{% endfor %}
-----------
这是我的完整代码。
{% with followers=current_user.get_profile.get_following.all %}
{% for follower in followers %}
{% with recipes=follower.recipe_set.all %}
{% for recipe in recipes %}
{{ forloop.counter }}
{% endfor %}
{% endwith %}
{% endfor %}
{% endwith %}
结果 - >1 2 3 1 2 3 ...... 50
。它应该是53
。因此,我可以很容易地使用paginator
感谢
感谢您的回复。是的,我首先包含分页标记,然后是自动标记。 – Kulbir
如果我使用这个'{%autopaginate recipe 10%}'。它从第一个循环显示前10个结果,在同一个页面上显示来自第二个循环的10个以上结果。像'1 ... 10 1 ...... 10' – Kulbir