from re import T from dirtyfields import DirtyFieldsMixin from django.conf import settings from django.db import models from django.utils.translation import gettext_lazy from greg.models import BaseModel, Person, Sponsor class GregUserProfile(BaseModel): """ Link the django user to a Person or Sponsor. TODO: - Do we store other types of IDs? ID-porten (fnr), one time token etc? - Do we need to only create on User per person/sponsor? - """ user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) person = models.ForeignKey( Person, on_delete=models.CASCADE, related_name='user_profiles', blank=True, null=True ) sponsor = models.ForeignKey( Sponsor, on_delete=models.CASCADE, related_name='user_profiles', blank=True, null=True ) userid_feide = models.CharField(gettext_lazy("userid-feide"), max_length=150)