Can I suppress newlines with Django's template engine?
Posted
by ento
on Stack Overflow
See other posts from Stack Overflow
or by ento
Published on 2010-04-09T09:04:53Z
Indexed on
2010/04/09
9:13 UTC
Read the original article
Hit count: 328
django
|django-templates
In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags:
<ul>
<% for @item in @items -%>
<li><%= @item %></li>
<% end -%>
</ul>
becomes:
<ul>
<li>apple</li>
<li>banana</li>
<li>cacao</li>
</ul>
Is there a way to do this in Django? (Disclosure: I'm generating a csv file with Django)
© Stack Overflow or respective owner