Hi,
How do I display list of pages with a ListView object? For example display a link for each page (except maybe the current page):
previous 1 2 3 4 next
Currently I use the following in a view to display "previous" and "next":
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">next</a>
{% endif %}
I tried using a for loop with a template tag and a reference to page_obj, but I could not get it to work. Any ideas?
Thanks