summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/aggregates/general.py
diff options
context:
space:
mode:
authorDavid Chorpash <davidchorpash@gmail.com>2020-07-19 02:08:44 -0600
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-21 06:42:51 +0200
commit6ec5eb5d74fd18a91256010706ab8b5b583526a9 (patch)
treed233e66945939725ab3bbd1a4fa0b6d28182d37d /django/contrib/postgres/aggregates/general.py
parenta2e621b14e85836362b7fc0e6b1bf7d7ff98e42b (diff)
downloaddjango-6ec5eb5d74fd18a91256010706ab8b5b583526a9.tar.gz
Refs #31720 -- Defined default output_field of BoolAnd() and BoolOr() aggregate functions.
Diffstat (limited to 'django/contrib/postgres/aggregates/general.py')
-rw-r--r--django/contrib/postgres/aggregates/general.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/postgres/aggregates/general.py b/django/contrib/postgres/aggregates/general.py
index 00957bdab0..f78eed7a60 100644
--- a/django/contrib/postgres/aggregates/general.py
+++ b/django/contrib/postgres/aggregates/general.py
@@ -1,5 +1,5 @@
from django.contrib.postgres.fields import ArrayField
-from django.db.models import Aggregate, JSONField, Value
+from django.db.models import Aggregate, BooleanField, JSONField, Value
from .mixins import OrderableAggMixin
@@ -33,10 +33,12 @@ class BitOr(Aggregate):
class BoolAnd(Aggregate):
function = 'BOOL_AND'
+ output_field = BooleanField()
class BoolOr(Aggregate):
function = 'BOOL_OR'
+ output_field = BooleanField()
class JSONBAgg(OrderableAggMixin, Aggregate):