1

I wrote a template that displays a table, something in the form:

<table>
...
</table>

I would like the paginate the table: 10 rows per page.

I've tried using {% autopaginate object_list 10 %}, but I don't have a specific list to give as parameter (I want the rows of the table).

How can I do so? Thanks

Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
squish
  • 11
  • 2

1 Answers1

0

This may sound like a snarky response, but consider using the generic list_detail() renderer, passing in your template as the argument, and setting the optional argument paginate_by. This is an easier method (I think) than using autopaginate, and doesn't involve importing the pagination extras module into your template. You'll still have to write (in your template) handler for the is_paginated state, as well as next and prev and page handlers (if the page is paginated).

An article on Advanced Generic Views will probably be most enlightening.

Elf Sternberg
  • 16,129
  • 6
  • 60
  • 68