Opened 4 years ago

Last modified 4 years ago

#27229 assigned New feature

Allow using aggregates in ModelAdmin.list_display

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


The change list page in the administration panel should be able to display aggregate results.

For example - a sum of one of the columns that is displayed in the last row of the table.

See attached screenshot for another example.

Attachments (1)

django-admin.png (11.0 KB) - added by Dor 4 years ago.
Screenshot with aggregate cells

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by Dor

Attachment: django-admin.png added

Screenshot with aggregate cells

comment:1 Changed 4 years ago by Dor

Owner: changed from nobody to Dor
Status: newassigned

comment:2 Changed 4 years ago by Tim Graham

I guess this is the same or similar idea as #14336? It helps if you can explain a bit about what the implementation looks like. I guess you know it's already possible to some extent .

comment:3 Changed 4 years ago by Tim Graham

Has patch: set
Patch needs improvement: set
Summary: Add aggregates to change listAllow using aggregates in ModelAdmin.list_display
Triage Stage: UnreviewedAccepted

The PR looks interesting, but I'd like to see a proposal that also accommodates annotations (if even not implemented right now, it would be nice to figure out the design first). I don't know if it might be worth trying to be able to use expressions and aggregates directly in list_display . In any case, I'd like to see a discussion on the DevelopersMailingList to get a consensus on the design.

comment:4 Changed 4 years ago by Dor

I'll open a discussion in the mailing list. Thanks

comment:5 Changed 4 years ago by Dor

Can't get enough traction in the mailing list:!topic/django-developers/T1-80RV8b5g

Tim, perhaps you could help by chiming in?

Last edited 4 years ago by Dor (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top