#27511: related_model for GenericRelation is not None
--------------------------------------------------+------------------------
Reporter: Amir Keivan Mohtashami | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
--------------------------------------------------+------------------------
The documentation says for field.related_model:
If a field has a generic relation (such as a GenericForeignKey or a
GenericRelation) then related_model will be None.
However this is not true for GenericRelations. For these fields the
related_model points to the model the field relates to just like the
reverse of a ForeignKey. The documentation should be fixed, however this
means that to the best of my knowledge, there is no way to distinguish
between GenericRelation and reverse of a ForeignKey(short of checking if
the field is an instance of GenericRelation).
--
Ticket URL: <https://code.djangoproject.com/ticket/27511>
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/055.1a4784a6e407ea9c7c9afa906c15ba11%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.