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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion django-stubs/contrib/auth/models.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from django.contrib.auth.validators import UnicodeUsernameValidator
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.base import Model
from django.db.models.manager import EmptyManager
from django.db.models.manager import EmptyManager, ManyToManyRelatedManager

_AnyUser = Model | AnonymousUser

Expand All @@ -34,6 +34,7 @@ class Permission(models.Model):
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
codename = models.CharField(max_length=100)
def natural_key(self) -> tuple[str, str, str]: ...
group_set = ManyToManyRelatedManager["Group", "Permission"]()

_GroupT = TypeVar("_GroupT", bound=Group)

Expand All @@ -46,6 +47,7 @@ class Group(models.Model):
name = models.CharField(max_length=150)
permissions = models.ManyToManyField[Permission, Any](Permission)
def natural_key(self) -> tuple[str, ...]: ...
user_set = ManyToManyRelatedManager["PermissionsMixin", "Group"]()

class UserManager(BaseUserManager[_T]):
def create_user(
Expand Down
Loading