This is in my urls.py:
group_info = {
'queryset': Group.objects.all(),
'template_object_name': 'groups',
'paginate_by': 25,
}
And this is the relevant URL: (r '^ groups / $', 'django.views.generic.list_detail.object_list', group_info),
And this is my code in the template:
<div class="pagination">
<span class="step-links">
{% if groups.has_previous %}
<a href="?page={{ groups.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
Page {{ groups.number }} of {{ groups.paginator.num_pages }}.
</span>
{% if groups.has_next %}
<a href="?page={{ groups.next_page_number }}">next</a>
{% endif %}
</span>
</div>
.. but the page information is not displayed. I think that I am doing this in the same way as the documentation does. Any idea what is wrong?
Thank.
source
share