Answer the question
In order to leave comments, you need to log in
How to redirect to the first page of pagination in Flask when applying a filter?
There is a page with pagination according to the template ./pagenumber/, everything works. But if you go to the last page, and then apply the filter, and as a result, the number of pages will decrease, the "no records" situation occurs. Although they are on the first page for sure. How is it ideologically correct to reset the page number in this case?
Answer the question
In order to leave comments, you need to log in
Found the solution myself, changed the filter in the page template. It was
<form "{{request.path}}" method="get">
<input name="flt" value="{{flt_s}}">
<button type="search" >Найти</button>
</form>
<form action="/{{request.path.split('/')[1]}}" method="get">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question