aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/templates
diff options
context:
space:
mode:
authorTom Christie2013-10-02 13:45:35 +0100
committerTom Christie2013-10-02 13:45:35 +0100
commita14f1e886402b8d0f742fdbb912b03a4004e1735 (patch)
tree0ddb30e4c46d50ec76067fdd4726e7e76ac6964f /rest_framework/templates
parent1fd83adb9c1f888ed05d5b6d570b5e37996f96ba (diff)
downloaddjango-rest-framework-a14f1e886402b8d0f742fdbb912b03a4004e1735.tar.bz2
Serializers can now be rendered directly to HTML
Diffstat (limited to 'rest_framework/templates')
-rw-r--r--rest_framework/templates/rest_framework/form.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/rest_framework/templates/rest_framework/form.html b/rest_framework/templates/rest_framework/form.html
index b27f652e..b1e148df 100644
--- a/rest_framework/templates/rest_framework/form.html
+++ b/rest_framework/templates/rest_framework/form.html
@@ -1,13 +1,15 @@
{% load rest_framework %}
{% csrf_token %}
{{ form.non_field_errors }}
-{% for field in form %}
- <div class="control-group"> <!--{% if field.errors %}error{% endif %}-->
+{% for field in form.fields.values %}
+ {% if not field.read_only %}
+ <div class="control-group {% if field.errors %}error{% endif %}">
{{ field.label_tag|add_class:"control-label" }}
<div class="controls">
- {{ field }}
- <span class="help-block">{{ field.help_text }}</span>
- <!--{{ field.errors|add_class:"help-block" }}-->
+ {{ field.widget_html }}
+ {% if field.help_text %}<span class="help-block">{{ field.help_text }}</span>{% endif %}
+ {% for error in field.errors %}<span class="help-block">{{ error }}</span>{% endfor %}
</div>
</div>
+ {% endif %}
{% endfor %}