Skip to content Skip to sidebar Skip to footer

Adding Extended Profile Model Into Custom User Models Admin

How can i add extended Profile model fields (fields which are not available in custom user model fields) into custom users admin users.admin? what i am trying to do is that i want

Solution 1:

I would recommend that you override the User model.

from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
                                        PermissionsMixin
classUserManger(BaseUserManager):
    """
       Add extra calling functionalities here
    """passclassUser(AbstractBaseUser, PermissionsMixin):
    """Custom user model"""pass

    objects = UserManger()

This is the basic format. Add the extra profile fields in the model

in setting.py add

AUTH_USER_MODEL = '{{ app_name }}.{{ model_name }}'# eg. 'core.User'

Post a Comment for "Adding Extended Profile Model Into Custom User Models Admin"