{% if discounts %} {% regroup discounts by discount.description as discounts_grouped %} {% for discount_type in discounts_grouped %} <h4>{{ discount_type.grouper }}</h4> <ul> {% for discount in discount_type.list %} <li>{{ discount.quantity }} × {{ discount.clause }}</li> {% endfor %} </ul> {% endfor %} {% endif %}