I'm using ListView to display the search result, and using forms to let user input search values, here is the problem: when I get some search results, say, 50 items, and I set the item_per_page 30, so I got two pages, but now when I click the next page link, it forgets the former search request and shows me all of the items in page 2, how to fix this? My code is below:
my form fields are like this:
<form method="get" action="{% url 'query_student' %}">
#the form fields
</form>
my pagination template:
{% if is_paginated %}
<div class="pages">
{% if page_obj.has_previous %}
<a href="/student/querystudent?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
<span class="btnon">
page {{ page_obj.number }} total {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="/student/querystudent?page={{ page_obj.next_page_number }}">>next</a>
{% endif %}
</div>
{% endif %}