K
K
Katya2020-10-26 23:57:10
Django
Katya, 2020-10-26 23:57:10

How to display sum of all fields in Django Admin?

Hello everyone)) in general, such a problem - there is a table with replenishments from users (contains the user ID and the amount of replenishment) and you need to
5f97380f152d2430919360.jpeg
display the sum of all replenishments somewhere here.
Thanks in advance to everyone !!

PS: here they somehow add a button to this place, but I don't quite understand how it's done

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-10-27
@Kate_7z

https://docs.djangoproject.com/en/dev/ref/contrib/...
Add sum to extra_context, override appropriate template, and output variable there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question