Last active
December 18, 2015 22:49
-
-
Save BradWhittington/5857433 to your computer and use it in GitHub Desktop.
Form skillz for django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% csrf_token %} | |
{% if form.non_field_errors %}<div class="non_field_errors">{{form.non_field_errors}}</div>{%endif %} | |
{% for field in form.visible_fields %} | |
{% load klass %} | |
<div class="field_wrapper field_{{field.name}} input_{{field.field.widget|klass}} {% if field.errors %}has_errors{% endif %}"> | |
{% if field.field.widget|klass == 'CheckboxInput' %} | |
{{ field }} | |
{{ field.label_tag }} | |
{% else %} | |
{{ field.label_tag }} | |
{{ field }} | |
{% endif %} | |
{{ field.errors }} | |
{% if field.help_text %} | |
<p class="help_text">{{field.help_text}}</p> | |
{% endif %} | |
</div> | |
{% endfor %} | |
{% for hidden in form.hidden_fields %} | |
{{ hidden }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment