[Answered ]-Inheritance in Django: child class updates parent with empty fields

2πŸ‘

βœ…

I suspect the problem is that you are inheriting from auth_models.User. This is multi-table inheritance and isn’t really appropriate for this situation. See the django docs here: https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#extending-django-s-default-user

Which basically say if you want to store profile data in a separate table there is no need to extend auth_models.User. Just create a model with a OneToOneField to auth_models.User:

class UserProfile(models.Model):
    objects = UserProfileManager()
    organization = models.CharField(max_length=100)
    country = CountryField()
    is_verified = models.BooleanField(default=False)
    blocked = models.BooleanField(default=False)
    anonymous = models.BooleanField(default=False)
    user = models.OneToOneField(auth_models.User)

Leave a comment