Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Renamed get_cols to get_group_by_cols

  • Loading branch information...
commit 33aa18a6e3c831930bda0028222a26f9c1d96e66 1 parent c7d5f86
Anssi Kääriäinen authored January 11, 2014
12  django/db/models/lookups.py
@@ -54,8 +54,8 @@ def output_type(self):
54 54
     def relabeled_clone(self, relabels):
55 55
         return self.__class__(self.lhs.relabeled_clone(relabels))
56 56
 
57  
-    def get_cols(self):
58  
-        return self.lhs.get_cols()
  57
+    def get_group_by_cols(self):
  58
+        return self.lhs.get_group_by_cols()
59 59
 
60 60
 
61 61
 class Lookup(RegisterLookupMixin):
@@ -102,10 +102,10 @@ def relabeled_clone(self, relabels):
102 102
             new.rhs = new.rhs.relabeled_clone(relabels)
103 103
         return new
104 104
 
105  
-    def get_cols(self):
106  
-        cols = self.lhs.get_cols()
107  
-        if hasattr(self.rhs, 'get_cols'):
108  
-            cols.extend(self.rhs.get_cols())
  105
+    def get_group_by_cols(self):
  106
+        cols = self.lhs.get_group_by_cols()
  107
+        if hasattr(self.rhs, 'get_group_by_cols'):
  108
+            cols.extend(self.rhs.get_group_by_cols())
109 109
         return cols
110 110
 
111 111
     def as_sql(self, qn, connection):
2  django/db/models/sql/aggregates.py
@@ -94,7 +94,7 @@ def as_sql(self, qn, connection):
94 94
 
95 95
         return self.sql_template % substitutions, params
96 96
 
97  
-    def get_cols(self):
  97
+    def get_group_by_cols(self):
98 98
         return []
99 99
 
100 100
     @property
2  django/db/models/sql/compiler.py
@@ -106,7 +106,7 @@ def as_sql(self, with_limits=True, with_col_aliases=False):
106 106
 
107 107
         where, w_params = self.compile(self.query.where)
108 108
         having, h_params = self.compile(self.query.having)
109  
-        having_group_by = self.query.having.get_cols()
  109
+        having_group_by = self.query.having.get_group_by_cols()
110 110
         params = []
111 111
         for val in six.itervalues(self.query.extra_select):
112 112
             params.extend(val[1])
2  django/db/models/sql/datastructures.py
@@ -22,7 +22,7 @@ def field(self):
22 22
     def relabeled_clone(self, relabels):
23 23
         return self.__class__(relabels.get(self.alias, self.alias), self.target, self.source)
24 24
 
25  
-    def get_cols(self):
  25
+    def get_group_by_cols(self):
26 26
         return [(self.alias, self.target.column)]
27 27
 
28 28
     def get_lookup(self, name):
6  django/db/models/sql/expressions.py
@@ -24,11 +24,11 @@ def relabeled_clone(self, change_map):
24 24
                                    (change_map.get(col[0], col[0]), col[1])))
25 25
         return clone
26 26
 
27  
-    def get_cols(self):
  27
+    def get_group_by_cols(self):
28 28
         cols = []
29 29
         for node, col in self.cols:
30  
-            if hasattr(node, 'get_cols'):
31  
-                cols.extend(node.get_cols())
  30
+            if hasattr(node, 'get_group_by_cols'):
  31
+                cols.extend(node.get_group_by_cols())
32 32
             elif isinstance(col, tuple):
33 33
                 cols.append(col)
34 34
         return cols
10  django/db/models/sql/where.py
@@ -153,16 +153,16 @@ def as_sql(self, qn, connection):
153 153
                 sql_string = '(%s)' % sql_string
154 154
         return sql_string, result_params
155 155
 
156  
-    def get_cols(self):
  156
+    def get_group_by_cols(self):
157 157
         cols = []
158 158
         for child in self.children:
159  
-            if hasattr(child, 'get_cols'):
160  
-                cols.extend(child.get_cols())
  159
+            if hasattr(child, 'get_group_by_cols'):
  160
+                cols.extend(child.get_group_by_cols())
161 161
             else:
162 162
                 if isinstance(child[0], Constraint):
163 163
                     cols.append((child[0].alias, child[0].col))
164  
-                if hasattr(child[3], 'get_cols'):
165  
-                    cols.extend(child[3].get_cols())
  164
+                if hasattr(child[3], 'get_group_by_cols'):
  165
+                    cols.extend(child[3].get_group_by_cols())
166 166
         return cols
167 167
 
168 168
     def make_atom(self, child, qn, connection):

0 notes on commit 33aa18a

Please sign in to comment.
Something went wrong with that request. Please try again.