[Answer]-Django paginator to include all elements of all previous pages

1👍

enter code hereIt’s normal, because, this is what the object Paginator do

page1 = p.page(1)
page1.object_list

[1, 2, 3, 4, 5] (5 items per page, from item(1) to item(5), this is the first page)

page2 = p.page(2)
page2.object_list

[‘6’, ‘7’, ‘8’, ‘9’, ’10’](5 items per page, from item(6) to item(10),this is the second page)

The definition of object Paginator:
Give Paginator a list of objects, plus the number of items you’d like to have on each page,

👤hassan

Leave a comment