As for django to generate dynamic query string in the template?

There is some page with a list of articles based on the ListView
I added a few blocks of hyperlinks, sort, and display articles such as:
Unit 1
Full|Brief

Unit 2
Per day|Per week|Per month

Unit 3 (the number of articles per page)
10/20/50

The output settings I give in the query string:
article/?sort=table&pag=10&date=week

I tried to do it through
@register.simple_tag
def dinamic(value, str_filtre, str_value):


forming in the template something like:
<a href="{% url 'article:list' %}{% dinamic request.get_full_path "sort" "list" %}">full</a>|

but it's not a goldfish... settings zadavayte clicking twice on one unit, for example (by date)
article/?sort=table&pag=15&date=week&date=month
tell me method of forming such links. Throw an example.. I would be grateful
June 3rd 19 at 19:16
2 answers
June 3rd 19 at 19:18
Hmm dinamic-e will replace tried? Yuzaete https://docs.python.org/3/library/urllib.parse.htm...
June 3rd 19 at 19:20
Forming URLs for the current page can be something like this.

@register.simple_tag(takes_context=True)
def dinamic(context, **kwargs):
 request = context['request']
 qparams = request.GET.dict()
qparams.update(**kwargs)
 return '{}?{}'.format(request.path_info,
 urlencode(qparams))


{% dinamic param1='value1' %}
It's not very clear.. But the template parameters param1 and value1 that is passed? - winfield.Von commented on June 3rd 19 at 19:23
For example, {% dinamic date='week' %} - Maxine_Turner commented on June 3rd 19 at 19:26

Find more questions by tags Django