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:
Lenno Nagel 2023-06-13 07:27:37 +03:00 committed by GitHub
parent a180bde0fd
commit 833313496c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }}">