Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@katie7r
Created June 15, 2018 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katie7r/2e6549b1d1a349d30beb9046d73c9aac to your computer and use it in GitHub Desktop.
Save katie7r/2e6549b1d1a349d30beb9046d73c9aac to your computer and use it in GitHub Desktop.
Django pseudonymization example (1) - User queryset
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