zhongrj
2025-11-25 b89962006164a462404b79a738bee8cbb6d7fe7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% load bootstrap_extras %}
 
<div class="form-group {% if field.errors %}has-error{% endif %}">
    <label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
    <div class="col-sm-10 ">
        {{ field|with_class:'form-control' }}
        {% if field.errors %}
            <span class='text-danger'>{{ field.errors|join:'<br />' }}</span>
        {% endif %}
        {% if field.help_text %}
            <span class="help-block ">{{ field.help_text }}</span>
        {% endif %}
    </div>
</div>