Saturday, August 13, 2011

template newlines

I'm using the django template system for format a text email. I send
it a dictionary and it formats the output. The problem is that it
inserts lots of newlines

Here is the template, and reports is a dictionary that contains an
event and a dictionary of interests

Weekly Contact List For {{date}}
{% for event, interests in report.items %}
{% if interests|length > 0 %}
{{event}}
{% for interest, value in interests.items %}
{{ value }} {% if value == 1 %} lead {% else %} leads {%
endif %} for {{ interest }}
{% endfor %}
{% endif %}
{% endfor %}

Is there a way for it just to print the lines without adding all the
extra blank lines when interests = 0?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate