You can define different groups for each role and assign the users to the groups.
Em sex, 5 de jun de 2015 às 11:24, Andreas Kuhne <[email protected]> escreveu: > Hi Marcelle, > > You should not use the user profile solution anymore, because you can now > create a custom User model instead. Check for example: > http://www.lasolution.be/blog/creating-custom-user-model-django-16-part-1.html > > This way you can add fields that are needed for your user solutions in > your own user model. You can of course also add models that are specific > for each type of user if you want. > > Regards, > > Andréas > > 2015-06-04 22:56 GMT+02:00 marcelle Kouam <[email protected]>: > >> 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 >> <https://groups.google.com/d/msgid/django-users/1fbb0a3c-e0ea-48d2-b606-0c7db2bffb5d%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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/CALXYUbnHGxKEUC6vRXZi_MzCzY_VZmCcMdoAY1ypY0h03BxtaA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CALXYUbnHGxKEUC6vRXZi_MzCzY_VZmCcMdoAY1ypY0h03BxtaA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CACPst9KqHbuCuCwEF9pS2%2B8J7P2QJjXmn1-NVOiT%3DrEv%2BpEdUQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

