Displaying Django Messages Framework Messages
- by Arif
I have been using the Django Messaging Framework to display messages to a user in the template.
I am outputting them to the template like this:
<ul>
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
This outputs all the messages, errors, warning, success etc.
I was just wondering if anyone had any ideas how to display only the error messages something like:
<ul>
{% for message in messages.errors %}
<li>{{ message }}</li>
{% endfor %}
</ul>
Any ideas?
Thanks in advance.