#24289: Is usage of many_to_one and one_to_many terms confusing for relation
flags?
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8alpha1
(models, ORM) |
Severity: Release blocker | 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 loic):
From my understanding historically `Field.rel` meant "relation", not
"related field". This only changed with #21414 where we replaced
`RelatedObject` by `*Rel` objects and the meta refactor that made these
show up in `get_fields()`.
So if anything I find that `isinstance(ForeignKey.rel, ManyToOneRel) ==
True` is consistent with `ForeignKey.many_to_one == True`.
Also I wouldn't get to hung up on the naming of `*Rel` or `*Descriptor`
objects, naming of things in `related.py` is extremely confusing and
inconsistent.
I'm really +1 on swapping them, the "to" from `ForeignKey(to=Company)`
should mean the same thing as the "to" from "ForeignKey.many_to_one" IMO.
I really don't like `has_many` (it was initially part of the meta
refactor) specifically because of fields like `ArrayField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/24289#comment:14>
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/066.fc4e3b156b49932a1580af92b50e6888%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.