You can create a "parameter string". Suppose you have in your code:
my_view( request, page, options): sort_choices = {P:'price',N:'name', ...} n_item_choices = {'S':5, 'L':50, 'XL':100) ascending_descending_choices = {'A':'', 'D':'-'} ...
then you can use concatenat options like:
options='PSD' #order by price, 5 items per page, descending order
encode gadgets as:
<a href="?page={{ prev_page }}&options={{ options }}">Previous</a>
then in urls.py capture options and in view:
my_view( request, page, options): ... #choides .... try: optionsArray = options.split('-') sort_by = sort_choices[ optionsArray[0] ] n_ites_page = n_item_choices[ optionsArray[1] ] asc_or_desc = ascending_descending_choices[ optionsArray[2] ] ... except: somebody is playing ....
using this method you can add additional paginations parameters without changing urls.py, all you need to do is add options at the end of the line parameters. This has advantages, but also some dangers: I hope you can identify the risks.
source share