#31442: Inherited ManyToMany.all() empty with multiple inherited models of same
name from abstract one
-------------------------------------+-------------------------------------
Reporter: Gereon Kremer | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => invalid
Comment:
OK, thanks. So the system check error that spells out the problem:
{{{
$ ./manage.py makemigrations
SystemCheckError: System check identified some issues:
ERRORS:
app1.Child.field1: (fields.E305) Reverse query name for 'Child.field1'
clashes with reverse query name for 'Child.field1'.
HINT: Add or change a related_name argument to the definition for
'Child.field1' or 'Child.field1'.
app2.Child.field1: (fields.E305) Reverse query name for 'Child.field1'
clashes with reverse query name for 'Child.field1'.
HINT: Add or change a related_name argument to the definition for
'Child.field1' or 'Child.field1'.
}}}
See the docs section:
[https://docs.djangoproject.com/en/3.0/topics/db/models/#be-careful-with-
related-name-and-related-query-name Be careful with related_name and
related_query_name]. Specify something like
`related_name="%(app_label)s_%(class)s_related"` on the ManyToManyField on
the abstract model.
--
Ticket URL: <https://code.djangoproject.com/ticket/31442#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/063.7dcdaf31f9426fb270dc0b9310a66982%40djangoproject.com.