summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2022-07-04 16:32:16 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-10-04 12:29:37 +0200
commita142edcc4981bb27f4356acad0c7fdfb2d5f9849 (patch)
tree4277047ef9f297834393eff6e37544c9ae38dad8 /django/db/models/sql/compiler.py
parentc583418e3ec2a7f2997f739a51ae07291c18070e (diff)
downloaddjango-a142edcc4981bb27f4356acad0c7fdfb2d5f9849.tar.gz
Avoided unnecessary call to .get_source_expressions().
The SQLCompiler._order_by_pairs() generator method yields instances of OrderBy and not Expression.
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 4f2783a635..4668a820fb 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -436,8 +436,8 @@ class SQLCompiler:
for expr, is_ref in self._order_by_pairs():
resolved = expr.resolve_expression(self.query, allow_joins=True, reuse=None)
if self.query.combinator and self.select:
- src = resolved.get_source_expressions()[0]
- expr_src = expr.get_source_expressions()[0]
+ src = resolved.expression
+ expr_src = expr.expression
# Relabel order by columns to raw numbers if this is a combined
# query; necessary since the columns can't be referenced by the
# fully qualified name and the simple column names may collide.