Created
June 15, 2018 14:59
-
-
Save katie7r/2e6549b1d1a349d30beb9046d73c9aac to your computer and use it in GitHub Desktop.
Django pseudonymization example (1) - User queryset
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
from django.db import models | |
from django.core.validators import RegexValidator | |
from django.contrib.auth.models import AbstractUser, UserManager as AuthUserManager | |
from app.utils import mask, unmask | |
class UserQuerySet(models.QuerySet): | |
pass | |
class UserManager(AuthUserManager): | |
def get_queryset(self): | |
return UserQuerySet(self.model) | |
class User(AbstractUser): | |
# ... | |
objects = UserManager() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment