paginator
を含めると、同じページに複数のpaginator
が印刷されます。私はforloop
に含まれているからです。この問題をどうやって解決するのですか?助けてください複数のページャーを取得する
ここに私のフルコードです。
{% 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
を使用することができますsetup.py file of django-paginationで感謝
返信ありがとうございます。はい、私はページングタグを含んでいますし、最初に自動タグ付けします。 – Kulbir
この '{%自動レシピ10%}'を使用しています。最初のループからの最初の10個の結果を表示し、同じページで2番目のループからさらに10個の結果を得る。 '1 ... 10 1 ...... 10'のように – Kulbir