mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-25 16:00:49 +03:00
Disable HTML inputs for dict/list fields (#5702)
This commit is contained in:
parent
6bd773e7f8
commit
b7ed645927
|
@ -320,6 +320,12 @@ class HTMLFormRenderer(BaseRenderer):
|
||||||
serializers.ListSerializer: {
|
serializers.ListSerializer: {
|
||||||
'base_template': 'list_fieldset.html'
|
'base_template': 'list_fieldset.html'
|
||||||
},
|
},
|
||||||
|
serializers.ListField: {
|
||||||
|
'base_template': 'list_field.html'
|
||||||
|
},
|
||||||
|
serializers.DictField: {
|
||||||
|
'base_template': 'dict_field.html'
|
||||||
|
},
|
||||||
serializers.FilePathField: {
|
serializers.FilePathField: {
|
||||||
'base_template': 'select.html',
|
'base_template': 'select.html',
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
|
||||||
|
{{ field.label }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<p class="form-control-static">Dictionaries are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
|
||||||
|
{{ field.label }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<p class="form-control-static">Lists are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label class="sr-only">
|
||||||
|
{{ field.label }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p class="form-control-static">Dictionaries are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label class="sr-only">
|
||||||
|
{{ field.label }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p class="form-control-static">Lists are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p class="form-control-static">Dictionaries are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="form-group">
|
||||||
|
{% if field.label %}
|
||||||
|
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p class="form-control-static">Lists are not currently supported in HTML input.</p>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user