Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed get_cols to get_group_by_cols

  • Loading branch information...
commit 33aa18a6e3c831930bda0028222a26f9c1d96e66 1 parent c7d5f86
@akaariai akaariai authored
View
12 django/db/models/lookups.py
@@ -54,8 +54,8 @@ def output_type(self):
def relabeled_clone(self, relabels):
return self.__class__(self.lhs.relabeled_clone(relabels))
- def get_cols(self):
- return self.lhs.get_cols()
+ def get_group_by_cols(self):
+ return self.lhs.get_group_by_cols()
class Lookup(RegisterLookupMixin):
@@ -102,10 +102,10 @@ def relabeled_clone(self, relabels):
new.rhs = new.rhs.relabeled_clone(relabels)
return new
- def get_cols(self):
- cols = self.lhs.get_cols()
- if hasattr(self.rhs, 'get_cols'):
- cols.extend(self.rhs.get_cols())
+ def get_group_by_cols(self):
+ cols = self.lhs.get_group_by_cols()
+ if hasattr(self.rhs, 'get_group_by_cols'):
+ cols.extend(self.rhs.get_group_by_cols())
return cols
def as_sql(self, qn, connection):
View
2  django/db/models/sql/aggregates.py
@@ -94,7 +94,7 @@ def as_sql(self, qn, connection):
return self.sql_template % substitutions, params
- def get_cols(self):
+ def get_group_by_cols(self):
return []
@property
View
2  django/db/models/sql/compiler.py
@@ -106,7 +106,7 @@ def as_sql(self, with_limits=True, with_col_aliases=False):
where, w_params = self.compile(self.query.where)
having, h_params = self.compile(self.query.having)
- having_group_by = self.query.having.get_cols()
+ having_group_by = self.query.having.get_group_by_cols()
params = []
for val in six.itervalues(self.query.extra_select):
params.extend(val[1])
View
2  django/db/models/sql/datastructures.py
@@ -22,7 +22,7 @@ def field(self):
def relabeled_clone(self, relabels):
return self.__class__(relabels.get(self.alias, self.alias), self.target, self.source)
- def get_cols(self):
+ def get_group_by_cols(self):
return [(self.alias, self.target.column)]
def get_lookup(self, name):
View
6 django/db/models/sql/expressions.py
@@ -24,11 +24,11 @@ def relabeled_clone(self, change_map):
(change_map.get(col[0], col[0]), col[1])))
return clone
- def get_cols(self):
+ def get_group_by_cols(self):
cols = []
for node, col in self.cols:
- if hasattr(node, 'get_cols'):
- cols.extend(node.get_cols())
+ if hasattr(node, 'get_group_by_cols'):
+ cols.extend(node.get_group_by_cols())
elif isinstance(col, tuple):
cols.append(col)
return cols
View
10 django/db/models/sql/where.py
@@ -153,16 +153,16 @@ def as_sql(self, qn, connection):
sql_string = '(%s)' % sql_string
return sql_string, result_params
- def get_cols(self):
+ def get_group_by_cols(self):
cols = []
for child in self.children:
- if hasattr(child, 'get_cols'):
- cols.extend(child.get_cols())
+ if hasattr(child, 'get_group_by_cols'):
+ cols.extend(child.get_group_by_cols())
else:
if isinstance(child[0], Constraint):
cols.append((child[0].alias, child[0].col))
- if hasattr(child[3], 'get_cols'):
- cols.extend(child[3].get_cols())
+ if hasattr(child[3], 'get_group_by_cols'):
+ cols.extend(child[3].get_group_by_cols())
return cols
def make_atom(self, child, qn, connection):
Please sign in to comment.
Something went wrong with that request. Please try again.