#28931: Non-conflicting `related_name` and `related_query_name` for `groups`
column
and `user_permissions` in `PermissionsMixin`
-------------------------------------+-------------------------------------
Reporter: Saiteja | Owner: nobody
Parsi |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 2.0
layer (models, ORM) | Keywords: related_name,
Severity: Normal | related_query_name, Abstract base
Triage Stage: | classes, Model inheritance
Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
''AbstractUser'' extends ''PermissionsMixin'' to add the fields and
methods necessary to support the ''Groups'' and ''Permission''.
''PermissionsMixin'' defines ''groups'' and ''user_permissions'' columns
with many to many fields, both of which has a constant value for
''related_name'' and ''related_query_name' keys'. As ''AbstractUser''
inherit these fields, there is a high chance that these values raise
conflicts when there are multiple classes inheriting from this abstract
class, AbstractUser. So I suggest that instead of constant values for
''related_name'' and ''related_query_name' in ''PermissionsMixin', they
should be dynamic values as described
[https://docs.djangoproject.com/en/2.0/topics/db/models/#be-careful-with-
related-name-and-related-query-name here].
--
Ticket URL: <https://code.djangoproject.com/ticket/28931>
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/051.3a81e774547f993be54047f77ec382f5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.