Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Victor Hooi
Hi, What is the current canonical way to handle multiple user-profiles in Django? For example - say you have "Teachers", "Students", "Parents" - you may have slightly different fields for each one and/or different behaviour. Students will have things like grades, Parents may have 1-to-many Stu

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-14 Thread Victor Hooi
Resurrecting a slightly old thread =), but coming back to this project. Say I have multiple models that each have their own user profile. Let's assume that each type of user is mutually exclusive (i.e. a student cannot be a teacher etc.) > > class Student(models.Model): > user = models.One

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-18 Thread Victor Hooi
Aha, thanks for the good points. I could go down the route of using auth.groups. I'd still need a user profile to store the additional fields - are you thinking I should only have a single Profile class, and make all the fields nullable? The issue though is still - how do I integrate this with G

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Mike Dewhirst
On 9/11/2016 11:54 AM, Victor Hooi wrote: Hi, What is the current canonical way to handle multiple user-profiles in Django? For example - say you have "Teachers", "Students", "Parents" - you may have slightly different fields for each one and/or different behaviour. Students will have thing

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-09 Thread Melvyn Sopacua
Hi, > What is the current canonical way to handle multiple user-profiles in > Django? it highly depends on how you see these objects: 1. different types of users (requirement: a user can only be one type) 2. one type of user with additional information from different sources 3. different types o

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-13 Thread Vineet Kothari
Use one to many field or many to many field On Wed, Nov 9, 2016 at 3:06 PM, Melvyn Sopacua wrote: > Hi, > > > What is the current canonical way to handle multiple user-profiles in > > Django? > > it highly depends on how you see these objects: > > 1. different types of users (requirement: a user