{% for field in form.visible_fields %}
    <div class="control-group {% if field.errors %} error {% endif %} ">
        <label class="control-label">
            {{ field.label }}
        </label>
        <div class="controls">
            {{ field }}
            <span class="help-inline">
                {% if field.errors %} {{ field.errors }} {% endif %}
            </span>
        </div>
    </div>
{% endfor %}
{%for field in form.hidden_fields %}
    {{ field }}
{% endfor %}