| 1 |
from django.contrib.auth.models import PermissionsMixin |
| 2 |
from django.db import models |
| 3 |
from django.utils.translation import gettext_lazy as _ |
| 4 |
|
| 5 |
|
| 6 |
class CustomGroupPermissionsMixin(PermissionsMixin): |
| 7 |
groups = models.ManyToManyField( |
| 8 |
"CustomGroup", |
| 9 |
verbose_name=_("groups"), |
| 10 |
blank=True, |
| 11 |
help_text=_( |
| 12 |
"The groups this user belongs to. A user will get all permissions granted to each of their groups." |
| 13 |
), |
| 14 |
related_name="user_set", |
| 15 |
related_query_name="user", |
| 16 |
) |
| 17 |
|
| 18 |
class Meta(PermissionsMixin.Meta): |
| 19 |
abstract = True |