aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/templates
diff options
context:
space:
mode:
authorMichael Elovskikh2013-02-15 16:39:24 +0600
committerMichael Elovskikh2013-02-15 16:39:24 +0600
commit3195f72784a2d55d10f3d7a58acdfee694e89e4b (patch)
tree8fb50312b8e826a4ff87abd23493787a0e5c5add /rest_framework/templates
parentd3f6536365cefa01f93cfadcc5e6a737d5c5fa80 (diff)
downloaddjango-rest-framework-3195f72784a2d55d10f3d7a58acdfee694e89e4b.tar.bz2
POST form using new form.html template
Diffstat (limited to 'rest_framework/templates')
-rw-r--r--rest_framework/templates/rest_framework/base.html27
1 files changed, 9 insertions, 18 deletions
diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html
index 87e5dc04..fb541e94 100644
--- a/rest_framework/templates/rest_framework/base.html
+++ b/rest_framework/templates/rest_framework/base.html
@@ -125,25 +125,16 @@
{% if post_form %}
<div class="well">
- <form action="{{ request.get_full_path }}" method="POST" {% if post_form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
- <fieldset>
- {% csrf_token %}
- {{ post_form.non_field_errors }}
- {% for field in post_form %}
- <div class="control-group"> <!--{% if field.errors %}error{% endif %}-->
- {{ field.label_tag|add_class:"control-label" }}
- <div class="controls">
- {{ field }}
- <span class="help-inline">{{ field.help_text }}</span>
- <!--{{ field.errors|add_class:"help-block" }}-->
- </div>
+ {% with form=post_form %}
+ <form action="{{ request.get_full_path }}" method="POST" {% if form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
+ <fieldset>
+ {% include "rest_framework/form.html" %}
+ <div class="form-actions">
+ <button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
</div>
- {% endfor %}
- <div class="form-actions">
- <button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
- </div>
- </fieldset>
- </form>
+ </fieldset>
+ </form>
+ {% endwith %}
</div>
{% endif %}