Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ManyToManyRelatedManager to auth models #235

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Conversation

vforgione
Copy link

Adds managers for reverse names of many to many relationships in the contrib.auth app.

This is a small QoL improvement PR. It provides type checkers with the reverse relationships between:

  • Group and Permission: Permission has a typed .group_set manager object
  • PermissionMixin and Group: Group has a typed .user_set manager object

The reasons for using PermissionMixin rather than other possible models/mixins are (1) the relationship is defined in the mixin to begin with, and (2) this is compatible with any model that inherits the mixin - e.g. AbstractUser, User, or a custom user model.

Screenshot 2024-04-19 at 10 34 19 AM

Adds managers for reverse names of many to many relationships in the contrib.auth app.
Copy link
Owner

@sbdchd sbdchd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Great PR description too!!

@kodiakhq kodiakhq bot merged commit f0f1026 into sbdchd:main Apr 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants