summaryrefslogtreecommitdiff
path: root/django/db/models/sql/aggregates.py
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2013-05-26 23:47:50 -0300
committerRamiro Morales <cramm0@gmail.com>2013-05-26 23:47:50 -0300
commit0fa8d43e742ee8b480d938a47836b5a3720c2677 (patch)
tree19212a58dfb62be483ba5e8e24602c8f4def0c36 /django/db/models/sql/aggregates.py
parentd228c1192ed59ab0114d9eba82ac99df611652d2 (diff)
Replaced `and...or...` constructs with PEP 308 conditional expressions.
Diffstat (limited to 'django/db/models/sql/aggregates.py')
-rw-r--r--django/db/models/sql/aggregates.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/aggregates.py b/django/db/models/sql/aggregates.py
index 23b79923d1..2bd2b2f76f 100644
--- a/django/db/models/sql/aggregates.py
+++ b/django/db/models/sql/aggregates.py
@@ -99,7 +99,7 @@ class Count(Aggregate):
sql_template = '%(function)s(%(distinct)s%(field)s)'
def __init__(self, col, distinct=False, **extra):
- super(Count, self).__init__(col, distinct=distinct and 'DISTINCT ' or '', **extra)
+ super(Count, self).__init__(col, distinct='DISTINCT ' if distinct else '', **extra)
class Max(Aggregate):
sql_function = 'MAX'