diff options
| author | Bendeguz Csirmaz <csirmazbendeguz@gmail.com> | 2024-04-07 10:32:16 +0800 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-11-29 11:23:04 +0100 |
| commit | 978aae4334fa71ba78a3e94408f0f3aebde8d07c (patch) | |
| tree | dd1cc322769441a3dd28b952ce52e07c3f72f90a /django/db/models/sql/query.py | |
| parent | 86661f2449fb0903f72b3522c68e146934013377 (diff) | |
Fixed #373 -- Added CompositePrimaryKey.
Thanks Lily Foote and Simon Charette for reviews and mentoring
this Google Summer of Code 2024 project.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Lily Foote <code@lilyf.org>
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index b7b93c235a..cca11bfcc2 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -627,8 +627,12 @@ class Query(BaseExpression): if result is None: result = empty_set_result else: - converters = compiler.get_converters(outer_query.annotation_select.values()) - result = next(compiler.apply_converters((result,), converters)) + cols = outer_query.annotation_select.values() + converters = compiler.get_converters(cols) + rows = compiler.apply_converters((result,), converters) + if compiler.has_composite_fields(cols): + rows = compiler.composite_fields_to_tuples(rows, cols) + result = next(rows) return dict(zip(outer_query.annotation_select, result)) |
