hello,
I want to create differents types of user( manager, employee, client) in my model. but I don't know how to implemente this. I read many tutorials on the django site but I unable to implement this. thank for your help
this is my models.py
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class UserProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(User)
# The additional attributes we wish to include.
website = models.URLField(blank=True)
picture = models.ImageField(upload_to='profile_images', blank=True)
# Override the __unicode__() method to return out something meaningful!
def __str__(self):
return self.user.username
class EmployeeProfile(models.Model):
# This line is required. Links UserProfile to a User model instance.
user = models.OneToOneField(UserProfile)
# The additional attributes we wish to include.
birthday = models.DateField()
# Override the __unicode__() method to return out something meaningful!
def __str__(self):
return self.user.username
how can