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
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/1fbb0a3c-e0ea-48d2-b606-0c7db2bffb5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.