0

I want to load the slot of 10 items each time in django. When i click on load more button it should disply slot of next 10 items.

{% for book in books|slice:":10" %}

This is only displaying the first 10 items. But want to display all items in 10's slot. For that i dont want to use pagination. Is there any other way to do the same?

Wagh
  • 4,202
  • 5
  • 39
  • 62

1 Answers1

0

consider a variable in view such that

v="{}:{}".format(i,i+10)

increment the value according to requirement

{% for book in books|slice:"{{v}}" %}
sundar nataraj
  • 8,524
  • 2
  • 34
  • 46