Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!


Project Description

This is a small Django utility module to allow you to correctly annotate or aggregate based on the sum of a Boolean field. This answers the question “how many objects do I have related to this object where foo is True.


Usage is pretty simple:

from django_boolean_sum import BooleanSum


This will return instances of MyModel with a related_count attribute, which is the number of related instances which have priority=True.


From PyPI:

$ pip install django-boolean-sum


This has been tested solely on PostgreSQL and Sqlite, using Django 1.4. It also depends on internal Django components which are not documented, and therefore are subject to possible breaking changes in future versions.

It is very naive about multi-databases, assuming that the query is being made for the backend of the default database.


Pull Request it.

Release History

Release History

This version
History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_boolean_sum-0.2-py2-none-any.whl (3.4 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Mar 31, 2016
django-boolean-sum-0.2.tar.gz (1.9 kB) Copy SHA256 Checksum SHA256 Source Mar 31, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting