Opened 4 months ago

Last modified 3 months ago

#28462 new Bug

ModelAdmin.list_editable unusably slow and memory intensive with large datasets

Reported by: Ben Cole Owned by: nobody
Component: contrib.admin Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


Since 1.10 list_editable on ModelAdmin is unusable for Models with a large-ish dataset.

The problem is caused by a recent change to how the FormSet is generated for the admin. Previously it was generated from the ChangeList result list, but it has been changed to use the admin's get_queryset which will return more than the current "pageful" of results (potentially the entire dataset) causing Django to generate a form for each instance. This results in Django consuming all available RAM and in some cases the python instance crashing. My personal laptop became unresponsive and I had to force power off.


Change History (2)

comment:1 Changed 4 months ago by Tim Graham

Summary: list_editable unusable with large datasetsModelAdmin.list_editable unusably slow and memory intensive with large datasets
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 months ago by Tim Graham

Has patch: set
Needs tests: set

PR (without a test)

Note: See TracTickets for help on using tickets.
Back to Top