profile_pic

user.com

Break in a Django for loop

Please consider adding a break statement in the Django for loops.

It will make possible to handle use cases like:

{% for item in deal_list %}

{% if item.amount == 5 %}

Show content

{% break %}

{% endif %]

{% endfor %}

If a requested element is found inside an if block, print it and stop loop execution.

Please authenticate to join the conversation.

Sign in / Register

Upvoters
Status

Planned

Board

🧩 Feature Request

Date

17 days ago

Author

Dawid Tyburek

Subscribe to post

Get notified by email when there are changes.