sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
186 stars 62 forks source link

Add ManyToManyRelatedManager to auth models #235

Closed vforgione closed 4 months ago

vforgione commented 4 months ago

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:

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