Removed usage of field.choices that triggered full table load by lnagel · Pull Request #8950 · encode/django-rest-framework (original) (raw)
Description
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.
The reason why I found this was that HTML forms in the browsable API became extremely slow, but only when relation fields with many=True were being used.