Skip to content

Commit 8333134

Browse files
authored
Removed usage of field.choices that triggered full table load (#8950)
Removed the `{{ field.choices|yesno:",disabled" }}` block because this triggers the loading of full database table worth of objects just to determine whether the multi-select widget should be set as disabled or not. Since this "disabled" marking feature is not present in the normal select field, then I propose to remove it also from the multi-select.
1 parent a180bde commit 8333134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/templates/rest_framework/horizontal/select_multiple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{% endif %}
1212

1313
<div class="col-sm-10">
14-
<select multiple {{ field.choices|yesno:",disabled" }} class="form-control" name="{{ field.name }}">
14+
<select multiple class="form-control" name="{{ field.name }}">
1515
{% for select in field.iter_options %}
1616
{% if select.start_option_group %}
1717
<optgroup label="{{ select.label }}">

0 commit comments

Comments
 (0)