I have a line in my Django template that is too long:
{% for some_item, some_another_item, again_some_another_item_with_long_name in items %}
Is there a way to split it so that it looks nicer in the source code?
Using \
or just splitting doesn't work.
If you really want to keep those nasty long names, what I would do is:
{% for a, b, c in items %}
{% with a as some_item %}
{% with b as some_another_item %}
{% with c as again_some_another_item_with_long_name %}
bla bla bla ..
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With