mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-11 08:42:23 +03:00
POST form using new form.html template
This commit is contained in:
parent
d3f6536365
commit
3195f72784
|
@ -125,25 +125,16 @@
|
||||||
|
|
||||||
{% if post_form %}
|
{% if post_form %}
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<form action="{{ request.get_full_path }}" method="POST" {% if post_form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
|
{% 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>
|
<fieldset>
|
||||||
{% csrf_token %}
|
{% include "rest_framework/form.html" %}
|
||||||
{{ 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>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
|
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user