Skip to main content

I want to break the loop once a specific condition is matched inside a nested loop. Here’s a simplified version of my code:

{% for s in event.ESPPayload.vars.Shipment %}
  {% if s.Items|length > 0 %}
    {% for c in s.Items %}
      {% if c.availabilityStatus|lower != "preorder" %}
        <table role="presentation" border="0" align="center" cellpadding="0" cellspacing="0" width="100%" style="background:#FFFFFF;font-size: 14px; font-weight: bold;">
          <tbody>
            <tr>
              <td align="{{ align|default:'left' }}" style="padding: {{ padding_top|default:'20' }}px 50px {{ padding_bottom|default:'20' }}px 50px;">
                YOUR ORDER
              </td>
            </tr>
          </tbody>
        </table>

      {% endif %}
       
    {% endfor %}

  {% endif %}
{% endfor %}
 

Hey there, sorry to tell you but after some research I’m not sure Django supports break or continue tags.


Reply