Opened 8 years ago

Last modified 17 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
Pull Requests:7248 unmerged

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.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
  • If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

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

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

comment:5 by Dor, 8 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 8 years ago by Dor (previous) (diff)

comment:6 by Olivier Dalang, 17 months ago

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