Is there a way in getting the row number for items displayed in Paginator? For example, i set that a page should contain 50 items so, the next page row number should start at 51. However I cannot find any way to do this, and when I use forloop.counter
the row number resets every page.
Asked
Active
Viewed 2,992 times
3

Haikal Nashuha
- 2,958
- 7
- 44
- 67
1 Answers
11
You can use the add
template tag to add the current count from the paginator to the forloop
{{ forloop.counter.0|add:paginator.page.start_index }}

Timmy O'Mahony
- 53,000
- 18
- 155
- 177
-
2this is the solution! However, use `forloop.counter0` instead. Awesome! – Haikal Nashuha Mar 30 '12 at 09:23
-
3thanks, however in my case(using ListView) it was ```{{forloop.counter0|add:page_obj.start_index}}```. – Taranjeet Sep 28 '16 at 03:15