#34012: QuerySet.order_by() silently skips non-existing fields on related
fields.
-------------------------------------+-------------------------------------
Reporter: Klaas van Schelven | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Klaas van Schelven):
Good catch, this only happens when an explicit ordering is defined on the
`Parent`'s `Meta`:
{{{
from django.db import models
class Parent(models.Model):
class Meta:
ordering = ["id"]
class Child(models.Model):
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
}}}
Reproducable up to Django 4.1.1
--
Ticket URL: <https://code.djangoproject.com/ticket/34012#comment:3>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701834a53e32b-70fbc2d8-7875-496e-aa13-f835ea6192a2-000000%40eu-central-1.amazonses.com.