unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development
https://unfoldadmin.com
MIT License
1.94k stars 188 forks source link

In admin panel display aggregate values below change list table of models. #767

Closed yogesh-sirsat closed 2 months ago

yogesh-sirsat commented 2 months ago

Do you have any examples?

image

Is it a third party application feature request?

No

Describe your feature request

I can't seem to find a way to display aggregate values like in Order model there'll be amount field, and I want to display total amount sum of all the orders just below the change list table of Order model, and it should update total amount sum if data filtered.

I tried to edit ModelAdmin.changelist_view but its not working I don't know what's wrong, I've followed the folder structure as mentioned in docs, also shuffled INSTALLED_APPS up down no luck.

I'm not considering pagination should reflect on total sum amount, I just want to include case when I'll be filtering data based on date or search fields.

lukasvinclav commented 2 months ago

What I was considering to do is to add an option to load custom templates above and below this table where you can add your own html code. Adding an option to render with custom business logc (calculate the total value of column) is not in the plan.

lukasvinclav commented 2 months ago

Implemented in #776