Hi again Marcelle,

It really depends on how you want to implement it.

Here is one example which I think is pretty good:
http://scopyleft.fr/blog/2013/django-model-advanced-user-inheritance/

This way you create a new model for each type you want (Handler, Employee
and Client), and then you can check which kind of user it is.

Regards,

Andréas

2015-06-05 16:51 GMT+02:00 marcelle Kouam <[email protected]>:

> thanks for your responses
> I read the tutos that you have sended me andreas but it just implement one
> user.
> but I want to have a structure which implements 3 types of users( handler,
> employee and client). can you give a clear example to do this.
> thank for your help
>
> Le vendredi 5 juin 2015 05:31:19 UTC-4, daniel.franca a écrit :
>>
>> 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/99a45ba1-789a-4edf-8531-acbb4dfcae59%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/99a45ba1-789a-4edf-8531-acbb4dfcae59%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/CALXYUbktSLFdJ4F8%3DGTVdXiBHbmXB3E6j%3DNOZK-e0a%3DYJ%2BC0rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to