Skip to content Skip to sidebar Skip to footer

Range Not Working In For Loop

My for loop is not working and I'm not sure why. This is the loop: {% for i in range({{text|length}} + {{images|length}}) %} text and images are querysets I have passed to the tem

Solution 1:

{% for i in range((text|length) + (images|length)) %}

That should fix it. The {{}} are used for another purpose. I have my own problem in jinja2 and haven't used it before. My loop is:

{% for i in range(string1|length) %}

and it works

Post a Comment for "Range Not Working In For Loop"