diff options
| author | Simon Charette <charette.s@gmail.com> | 2025-01-07 00:02:31 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-01-08 10:20:48 +0100 |
| commit | 42e8f264ce55710056b0033682ec6fd662a25b29 (patch) | |
| tree | 19fb128be8a41b2bba9b3a36a09b48bdb75dd346 /django/db/models/sql/compiler.py | |
| parent | 7617d5be94a6e348d5ddf4644985b24235822034 (diff) | |
Fixed #36065 -- Fixed ordering by expression referencing composite primary key.
Thanks Jacob Walls for the report and test and Csirmaz Bendegúz for the review.
Diffstat (limited to 'django/db/models/sql/compiler.py')
| -rw-r--r-- | django/db/models/sql/compiler.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 5bb491d823..251cc08e51 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -1117,10 +1117,9 @@ class SQLCompiler: ) return results targets, alias, _ = self.query.trim_joins(targets, joins, path) - target_fields = composite.unnest(targets) return [ (OrderBy(transform_function(t, alias), descending=descending), False) - for t in target_fields + for t in targets ] def _setup_joins(self, pieces, opts, alias): |
