You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #1082 (banner admin). A deep-dive audit of all 16 model-admin changelist (list) pages surfaced two cross-cutting themes plus several latent bugs. This issue tracks the multi-phase cleanup.
Theme 1 — N+1 query performance (biggest impact)
Many changelists have callable columns (counts, author lists, "most recent artifact", thumbnails) that hit the DB per row, with no select_related/prefetch_related/annotate, and most inherit Django's default 100 rows/page.
ProjectAdmin — ~10 DB-touching callable columns; a full list page can fire 1,000+ queries.
PersonAdmin — 14 columns, nearly all reverse-relation walks; PositionRoleListFilter also loops over every Person on every request.
Publication/Talk/Poster/Video/Grant/Award have M2M/FK callables (authors, projects, sponsor, recipients) with no prefetch.
Theme 2 — findability gaps
News and Keyword had no search box at all.
Could not search Publications/Talks/Posters by author name.
Several admins had no default ordering (Poster, Project, Sponsor, Keyword, ProjectUmbrella).
date_hierarchy absent on every date-driven model.
Latent bugs
NewsAdmin.get_display_thumbnail was not exception-guarded → one corrupt image 500s the whole News changelist.
PhotoAdmin.get_resolution_as_str reads image dimensions per row and raises if the file is missing.
Follow-up to #1082 (banner admin). A deep-dive audit of all 16 model-admin changelist (list) pages surfaced two cross-cutting themes plus several latent bugs. This issue tracks the multi-phase cleanup.
Theme 1 — N+1 query performance (biggest impact)
Many changelists have callable columns (counts, author lists, "most recent artifact", thumbnails) that hit the DB per row, with no
select_related/prefetch_related/annotate, and most inherit Django's default 100 rows/page.PositionRoleListFilteralso loops over every Person on every request.Theme 2 — findability gaps
ordering(Poster, Project, Sponsor, Keyword, ProjectUmbrella).date_hierarchyabsent on every date-driven model.Latent bugs
NewsAdmin.get_display_thumbnailwas not exception-guarded → one corrupt image 500s the whole News changelist.PhotoAdmin.get_resolution_as_strreads image dimensions per row and raises if the file is missing.Phased plan
search_fields(incl. author search), fixed DateField string-searches, missingordering,date_hierarchyon date models. Config-only, no query-shape changes.get_querysetannotations + prefetch, page-size caps, verified with before/after query counts.list_prefetch_related/list_select_relatedon Publication/Talk/Poster/Video/Grant/Award.list_editableinline toggles, bulk actions (project visibility, BibTeX export), Keyword cleanup tooling (unused-tag filter, broaden usage counts, merge action), Photoprojectcolumn + guardget_resolution_as_str.Admin pages are not Pa11y-scanned and these touch no models/migrations.