Building urls with django template system

Viewed 64

So I need to build an url querying multiple objects. I tried to use the template system from django to build it with no success. I was wondering if there is any way of doing this in the template or if I should just write a view function.

{% url 'service-ticket/new' as request %}
    {% with request|add:"?" as request %} {% endwith %}
    {% for entry in object.items.all %}
        {% with request|add:"spareparts="|add_string:entry.item.id|add:"&" as request %} 
    {% endwith %}
    {% endfor %}
<a class="btn-add float-right" href={{ request }} role="button">
THIS SHOW HAVE ALL
</a>
0 Answers
Related