Opened 8 years ago

Last modified 6 months ago

#27229 assigned New feature

Allow using aggregates in ModelAdmin.list_display

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

Description

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 8 years ago.
Screenshot with aggregate cells

Download all attachments as: .zip

Change History (7)

by Dor, 8 years ago

Attachment: django-admin.png added

Screenshot with aggregate cells

comment:1 by Dor, 8 years ago

Owner: changed from nobody to Dor
Status: newassigned

comment:2 by Tim Graham, 8 years ago

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 by Tim Graham, 8 years ago

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 by Dor, 7 years ago

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

comment:5 by Dor, 7 years ago

Can't get enough traction in the mailing list: https://groups.google.com/forum/#!topic/django-developers/T1-80RV8b5g

Tim, perhaps you could help by chiming in?

Last edited 7 years ago by Dor (previous) (diff)

comment:6 by Olivier Dalang, 6 months ago

Cc: Olivier Dalang added
Note: See TracTickets for help on using tickets.
Back to Top