[Answer]-Append new criteria to actual search url during paging

1👍

Doniyor,

I believe you may want to add the other parameters to the url when the page first loads, and you can set the state and score in the view so it populates those values in the rendered url. You can also set defaults for state and score in the view for when the visitor first comes to the page.

<a href="{% url 'name_of_view' %}?page={{ locs.next_page_number }}&state={{ state }}&score={{ score }}">next</a>

Or, if the GET parameters may be different for different renderings of the page, you could create the GET query string in the view and pass the whole thing to the anchor tag. (The query_parameters variable would be created by the view)

<a href="{% url 'name_of_view' %}?{{ query_parameters }}">next</a>

There are probably a few other ways to do this, but this is how I’ve handled similar situations.

I hope this helps,
Joe

👤Joe J

Leave a comment