Skip to main content

Django Admin Totals, add totals to your columns in Django admin.

Project description

Django Admin Totals

Module to show totals in Django Admin List.

codecov Build Status


virtualenv .
source bin/activate
pip install admin-totals


pip install git+





from admin_totals.admin import ModelAdminTotals
from django.contrib import admin
from django.db.models import Sum, Avg
from django.db.models.functions import Coalesce

class MyModelAdmin(ModelAdminTotals):
    list_display = ['col_a', 'col_b', 'col_c']
    list_totals = [('col_b', lambda field: Coalesce(Sum(field), 0)), ('col_c', Avg)]

Make sure to at least have the columns of list_totals in list_display.




Please make sure to run the following commands before pushing and making a PR:

pip install -r requirements/test-ci.txt
isort --recursive admin_totals tests

isort will sort the imports and flake8 will lint the code. Please fix any errors before committing. Also, make sure to write passing tests.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
admin_totals-1.0.1-py2-none-any.whl (25.1 kB) Copy SHA256 hash SHA256 Wheel py2
admin_totals-1.0.1-py3-none-any.whl (25.1 kB) Copy SHA256 hash SHA256 Wheel py3
admin-totals-1.0.1.tar.gz (6.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page