Manage help_text and errors

This commit is contained in:
Ludovic Stephan 2017-03-31 15:01:31 -03:00
parent fdcd2e864c
commit 49c84076de

View file

@ -4,7 +4,10 @@
<label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
<div class="col-sm-10">
{{ field|add_class:'form-control' }}
{% if field.errors %}
<span class="help-block">{{field.errors}}</span>
{% else %}
<span class="help-block">{{field.help_text}}</span>
<span class="help-block">{{ field.errors }}</span>
{% endif %}
</div>
</div>