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
1 changed files with 4 additions and 8 deletions

View File

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