mirror of
https://github.com/django/django.git
synced 2025-12-02 00:01:29 +00:00
Fixed #34012 -- Made QuerySet.order_by() apply transforms on related fields for models with Meta.ordering.
This makes QuerySet.order_by() no longer ignore trailing transforms for models with Meta.ordering. As a consequence, FieldError is raised in such cases for non-existent fields. Thanks to Klaas van Schelven for the report and Mariusz Felisiak for the review and advice.
This commit is contained in:
parent
649b28eab6
commit
4771a1694b
4 changed files with 20 additions and 1 deletions
|
|
@ -1819,6 +1819,7 @@ class Query(BaseExpression):
|
|||
final_transformer = functools.partial(
|
||||
transform, name=name, previous=final_transformer
|
||||
)
|
||||
final_transformer.has_transforms = True
|
||||
# Then, add the path to the query's joins. Note that we can't trim
|
||||
# joins at this stage - we will need the information about join type
|
||||
# of the trimmed joins.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue