I am trying to paginate my products catalog using paginate()
function that comes with Flask .
Inside catalog i am using a search filter to sort products depends on the filter itself, in the url i have more than 5 to 10 arguments, these arguments are always changing and i want the paginate path to contain them .
Inside template i am doing this:
{% if pagination.has_next or pagination.has_prev %}
{{
macros.pagination_widget(
pagination,
request.endpoint,
args=request.view_args
)
}}
{% endif %}
The issue is, request.view_args
always returns an empty dictionary , in fact the arguments are in url .
If i tried to hardcode all the arguments by using just some logic like {% if %}
and {% else %}
which i don't want to, the pagination works just fine .