formset_for_form should put the form's base_fields on the Formset class
|Reported by:||Brian Rosner||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When an inline in an
contains a field that maps to a
and has a ton of options (in my case 5,000+) the add/change pages are extremely slow. I began to trace the problem done and it looks like the root of the problem is each
has its own instance in memory for each form which results in one query per form in the inline. This gets worse when there is many
forms so only one query is ran.
It looks like it will be better for the Formset to hold the
and then place it on the
class before creating it so only one query would run for each form instance. Am I missing something here that would cause problems with this kind of solution?