#5891: formset_for_form should put the form's base_fields on the Formset class ---------------------------+------------------------------------------------ Reporter: brosner | Owner: nobody Status: new | Component: django.newforms Version: newforms-admin | Keywords: Stage: Unreviewed | Has_patch: 0 ---------------------------+------------------------------------------------ When an inline in an ```InlineModelAdmin``` contains a field that maps to a ```ForeignKey``` 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 ```ModelChoiceField``` 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 ```extra``` forms. There are really almost two ways to fix this problem and I am proposing to fix the code. The alternative is to use Javascript to add more ```extra``` forms so only one query is ran.
It looks like it will be better for the Formset to hold the ```base_fields``` and then place it on the ```BaseForm``` 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? -- Ticket URL: <http://code.djangoproject.com/ticket/5891> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
