mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 01:26:53 +03:00
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.
This commit is contained in:
parent
a180bde0fd
commit
833313496c
|
@ -11,7 +11,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select multiple {{ field.choices|yesno:",disabled" }} class="form-control" name="{{ field.name }}">
|
<select multiple class="form-control" name="{{ field.name }}">
|
||||||
{% for select in field.iter_options %}
|
{% for select in field.iter_options %}
|
||||||
{% if select.start_option_group %}
|
{% if select.start_option_group %}
|
||||||
<optgroup label="{{ select.label }}">
|
<optgroup label="{{ select.label }}">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user