#35751: Ordering a model via a m2m field creates unintended side effect for
ForeignKeys
-------------------------------------+-------------------------------------
Reporter: Dennis Scheiba | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: ORM ordering | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Dennis Scheiba):
I don't have enough expertise in the construction of an ORM to fully
understand all implications, but as you mentioned, an ordering by a m2m
relation is not explicit enough to be determined, and actually the LOC in
question was an overlook from my side. I did not expect that the ordering
of an item can be the cause for the multiplication of items and I instead
digged through the Manager implementation to find the cause.
Maybe a warning could have been helpful here as it fundamentally changes
the way the ORM behaves? I'd think that the edge cases where this actual
behavior is wanted can be done in a way which is more canonical within the
ORM.
In the end, a warning during boot procedure would have been nice for me
and would have saved me some headache - maybe even this issue is already
helpful enough for people.
--
Ticket URL: <https://code.djangoproject.com/ticket/35751#comment:5>
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/01070191e08d89bb-4079084a-60d5-4fec-b6dc-e8fe85c72c99-000000%40eu-central-1.amazonses.com.