0

I am working on a Django employee management system, I want the employee bio data on the same table as the user object used for registration and login

I tried adding the user model as a OnetoOneField on the employee table, but I don’t like having to register the user and then fill the employee form separately.

I want the users to be able to create their bio data while creating an account

  • 2
    Have you tried to google it? First hit: https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html – DrummerMann Mar 03 '23 at 21:38

2 Answers2

1

you can inherit AbstractBaseUser model and override it(add additionally fields in it) and you can do what exactly you want i.e

class User(AbstractBaseUser):
    date_joined = models.DateTimeField(auto_now_add=True)
    is_active = models.BooleanField(default=True)
    ---> rest of fields <------
Tanveer Ahmad
  • 706
  • 4
  • 12
0

database design may always vary depending on people. In such a case, I will inherit abstractbaseuser and keep everything in that table.