如果我包含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