mirror of
https://github.com/django/django.git
synced 2025-11-29 23:11:33 +00:00
Fixed #22466 -- ordering by reverse foreign key
Ordering by reverse foreign key was broken by custom lookups patch
(commit 20bab2cf9d).
Thanks to everybody who helped solving this issue. Special thanks to
Trac alias takis for reporting this.
This commit is contained in:
parent
fb7c347f7b
commit
3b7c66a3ac
2 changed files with 14 additions and 0 deletions
|
|
@ -1432,6 +1432,8 @@ class Query(object):
|
|||
alias = self.join(
|
||||
connection, reuse=reuse, nullable=nullable, join_field=join.join_field)
|
||||
joins.append(alias)
|
||||
if hasattr(final_field, 'field'):
|
||||
final_field = final_field.field
|
||||
return final_field, targets, opts, joins, path
|
||||
|
||||
def trim_joins(self, targets, joins, path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue