Answer the question
In order to leave comments, you need to log in
Distinct tag for django?
{% for order_product in order.products.all %}
<button class="btn"> {{ order_product.product.type }}</button>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
@register.filter()
def distinct(items):
return set(items)
{% for order_product in order.products.all|distinct %}
...
{% endfor %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question