Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7ed645

Browse files
Ryan P Kilbycarltongibson
Ryan P Kilby
authored andcommitted
Disable HTML inputs for dict/list fields (#5702)
1 parent6bd773e commitb7ed645

File tree

7 files changed

+60
-0
lines changed

7 files changed

+60
-0
lines changed

‎rest_framework/renderers.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ class HTMLFormRenderer(BaseRenderer):
320320
serializers.ListSerializer: {
321321
'base_template':'list_fieldset.html'
322322
},
323+
serializers.ListField: {
324+
'base_template':'list_field.html'
325+
},
326+
serializers.DictField: {
327+
'base_template':'dict_field.html'
328+
},
323329
serializers.FilePathField: {
324330
'base_template':'select.html',
325331
},
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<labelclass="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
4+
{{ field.label }}
5+
</label>
6+
{% endif %}
7+
8+
<divclass="col-sm-10">
9+
<pclass="form-control-static">Dictionaries are not currently supported in HTML input.</p>
10+
</div>
11+
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<labelclass="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
4+
{{ field.label }}
5+
</label>
6+
{% endif %}
7+
8+
<divclass="col-sm-10">
9+
<pclass="form-control-static">Lists are not currently supported in HTML input.</p>
10+
</div>
11+
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<labelclass="sr-only">
4+
{{ field.label }}
5+
</label>
6+
{% endif %}
7+
8+
<pclass="form-control-static">Dictionaries are not currently supported in HTML input.</p>
9+
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<labelclass="sr-only">
4+
{{ field.label }}
5+
</label>
6+
{% endif %}
7+
8+
<pclass="form-control-static">Lists are not currently supported in HTML input.</p>
9+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<label{%ifstyle.hide_label%}class="sr-only"{%endif%}>{{ field.label }}</label>
4+
{% endif %}
5+
6+
<pclass="form-control-static">Dictionaries are not currently supported in HTML input.</p>
7+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<divclass="form-group">
2+
{% if field.label %}
3+
<label{%ifstyle.hide_label%}class="sr-only"{%endif%}>{{ field.label }}</label>
4+
{% endif %}
5+
6+
<pclass="form-control-static">Lists are not currently supported in HTML input.</p>
7+
</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp