#19195: Using distinct([*fields]) filter on a foreign key produces an ordering
error when the foreign key has a Meta ordering field.
-------------------------------------+-------------------------------------
Reporter: chrisedgemon@… | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: distinct, query | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by charettes):
Calling `order_by('team_id')` doesn't raise a `FieldError` anymore on
Django 1.7 and silently behave just like `order_by('team')`.
If we want to avoid breaking code that might rely on this in 1.7 we should
fix it now. Else we'll have to deal with this by introducing an entry
point to `order_by` in order to opt-out of this unexpected behavior.
I wrote a patch for
[https://github.com/charettes/django/compare/ticket-19195-fk-order_by-
attname the order_by issue here].
--
Ticket URL: <https://code.djangoproject.com/ticket/19195#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/080.61ae9f95f01396a7fab49012ac1d7fb0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.