diff --git a/django/db/models/sql/aggregates.py b/django/db/models/sql/aggregates.py
index b41314a..f9d810a 100644
a
|
b
|
class Aggregate(object):
|
74 | 74 | elif isinstance(self.col, (list, tuple)): |
75 | 75 | field_name = '.'.join([qn(c) for c in self.col]) |
76 | 76 | else: |
77 | | field_name = self.col |
| 77 | field_name = qn(self.col) |
78 | 78 | |
79 | 79 | params = { |
80 | 80 | 'function': self.sql_function, |
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 3cd26d3..54e004f 100644
a
|
b
|
class SQLCompiler(object):
|
16 | 16 | self.query = query |
17 | 17 | self.connection = connection |
18 | 18 | self.using = using |
19 | | self.quote_cache = {} |
| 19 | self.quote_cache = {'*': '*'} |
20 | 20 | |
21 | 21 | def pre_sql_setup(self): |
22 | 22 | """ |