{% with theme=obj.theme.all %} {% for theme in obj.theme.all %} {{ theme.name }}{% if forloop.counter != themes|length %},{% endif %} {% endfor %} {% endwith %}