mirror of https://github.com/django/django.git
Avoided unnecessary call to .get_source_expressions().
The SQLCompiler._order_by_pairs() generator method yields instances of OrderBy and not Expression.
This commit is contained in:
parent
c583418e3e
commit
a142edcc49
|
@ -436,8 +436,8 @@ class SQLCompiler:
|
||||||
for expr, is_ref in self._order_by_pairs():
|
for expr, is_ref in self._order_by_pairs():
|
||||||
resolved = expr.resolve_expression(self.query, allow_joins=True, reuse=None)
|
resolved = expr.resolve_expression(self.query, allow_joins=True, reuse=None)
|
||||||
if self.query.combinator and self.select:
|
if self.query.combinator and self.select:
|
||||||
src = resolved.get_source_expressions()[0]
|
src = resolved.expression
|
||||||
expr_src = expr.get_source_expressions()[0]
|
expr_src = expr.expression
|
||||||
# Relabel order by columns to raw numbers if this is a combined
|
# Relabel order by columns to raw numbers if this is a combined
|
||||||
# query; necessary since the columns can't be referenced by the
|
# query; necessary since the columns can't be referenced by the
|
||||||
# fully qualified name and the simple column names may collide.
|
# fully qualified name and the simple column names may collide.
|
||||||
|
|
Loading…
Reference in New Issue