File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 77
77
db_functions
78
78
empty
79
79
expressions.tests.ExpressionOperatorTests
80
+ expressions.tests.FieldTransformTests.test_transform_in_values
80
81
expressions.tests.NegatedExpressionTests
81
82
expressions_case
82
83
defer
Original file line number Diff line number Diff line change @@ -153,9 +153,19 @@ def get_columns(self):
153
153
columns = (
154
154
self .get_default_columns (select_mask ) if self .query .default_cols else self .query .select
155
155
)
156
- return tuple ((column .target .column , column ) for column in columns ) + tuple (
157
- self .query .annotation_select .items ()
158
- )
156
+ annotation_idx = 1
157
+ result = []
158
+ for column in columns :
159
+ if hasattr (column , "target" ):
160
+ # column is a Col.
161
+ target = column .target .column
162
+ else :
163
+ # column is a Transform in values()/values_list() that needs a
164
+ # name for $proj.
165
+ target = f"__annotation{ annotation_idx } "
166
+ annotation_idx += 1
167
+ result .append ((target , column ))
168
+ return tuple (result ) + tuple (self .query .annotation_select .items ())
159
169
160
170
def _get_ordering (self ):
161
171
"""
You can’t perform that action at this time.
0 commit comments