﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35104	Make ModelAdmin.list_display only select proper fields	Mounir	nobody	"ModelAdmin list does always select all fields of the model.
When debugging this locally I got some issue when for example the model contain some big text fields.

A workaround of this is to use defer or only on the get_queryset to avoid the huge data to be loaded into the memory and causing the SQL request to take some time, despite explain analyse giving good results.

Would it be an option to enforce the usage of only on list_display to be the same as list_display when defined.

E.g:
{{{#!python
class Model(models.Model)
    name = ...
    large_xml_data = ...

@admin.register(Model)
class MyModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name']
}}}
when accessing /admin/models/ this would result into a `Model.objects.all().only(*MyModelAdmin.list_display)`."	Uncategorized	closed	contrib.admin	5.0	Normal	wontfix			Unreviewed	0	0	0	0	0	0
