forked from Corvia/django-tenant-users
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated changelog, updated test models and added tests
- Loading branch information
1 parent
f4b8728
commit e6e70b0
Showing
5 changed files
with
89 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import uuid | ||
from django.db import models | ||
from tenant_users.tenants.models import UserProfile | ||
|
||
from django.conf import settings | ||
from django.utils.translation import gettext_lazy as _ | ||
_NameFieldLength = 64 | ||
|
||
|
||
class GuidUser(UserProfile): | ||
guid = models.UUIDField(default=uuid.uuid4, primary_key=True) | ||
|
||
|
||
class TenantUser(UserProfile): | ||
"""Simple user model definition for testing.""" | ||
|
||
name = models.CharField(max_length=_NameFieldLength, blank=True) | ||
|
||
|
||
class GuidUser(UserProfile): | ||
guid = models.UUIDField(default=uuid.uuid4, primary_key=True) | ||
tenants = models.ManyToManyField( | ||
settings.TENANT_MODEL, | ||
verbose_name=_("tenants"), | ||
blank=True, | ||
help_text=_("The tenants this user belongs to."), | ||
related_name="guid_users_set", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters