In the form.html template cehcking the same condition is done twice.

Doing it once reduces complexity making the code faster while rendering.
Also since the check is done on a high level like templates, it is slower than
the native python if condition. Thus the need to reduce checks on the higher levels.
This commit is contained in:
arjoonn sharma 2015-03-06 11:36:06 +05:30
parent d1a2d9d104
commit 4326a2fbb6

View File

@ -1,15 +1,11 @@
{{ formset.management_form }} {{ formset.management_form }}
{% for form in formset %} {% for form in formset %}
{% if classes.label == 'sr-only' %} {% if classes.label == 'sr-only' %}
<div class="form-inline"> <div class="form-inline">
{% endif %}
{% include "bootstrapform/form.html" with form=form %} {% include "bootstrapform/form.html" with form=form %}
{% if classes.label == 'sr-only' %}
</div> </div>
{%else%}
{% include "bootstrapform/form.html" with form=form %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}