Re: Multiple User Types in Django 1.11

2017-07-25 Thread Gabriel - Iulian Dumbrava
You may go with Russ' solution or you may create two UserGroups, one for Students and one for Teachers, each having different access rights. This also allows for the edge case where a person may be a teacher and a student on the same time. Different behavior at python level can be implemented b

Re: Multiple User Types in Django 1.11

2017-07-24 Thread Russell Keith-Magee
Short version: You don’t. Your site may have 2 types of user - but that doesn’t mean you have 2 user models. The user model is primarily for determining authentication; authorisation can be handled separately. So - set up a user model the way you normally would; then define a Teacher model an

Re: Multiple user types

2010-02-19 Thread ALJ
... here's a solution I found really useful. It uses a base profile with inheritance. http://stackoverflow.com/questions/1796556/django-multi-table-inheritance-vs-specifying-explicit-onetoone-relationship-in-mo ALJ -- You received this message because you are subscribed to the Google Groups "D

Re: Multiple user types

2010-02-18 Thread David De La Harpe Golden
On 18/02/10 08:31, Sander wrote: Can you explain yourself a little bit more about the other one to one fields? Well, django has a "OneToOneField" field type, that is like ForeignKey" only assumes the two models are, well, one to one. And thus, the generated reverse relation accessor returns

Re: Multiple user types

2010-02-18 Thread Sander
Can you explain yourself a little bit more about the other one to one fields? Interrested in your ideas. On 17 feb, 14:13, David De La Harpe Golden wrote: > On 17/02/10 08:53, bruno desthuilliers wrote: > > > user.get_profile().student.student_number or > > user.get_profile().teacher.gender - bu

Re: Multiple user types

2010-02-17 Thread David De La Harpe Golden
On 17/02/10 08:53, bruno desthuilliers wrote: user.get_profile().student.student_number or user.get_profile().teacher.gender - but it works. I'm becoming pretty vague on what advantage the userprofile mechanism offers over other one to one fields to User. Is it just a convention at this stag

Re: Multiple user types

2010-02-17 Thread Sander
Sounds pretty straight forward. gonna try it out. Thanks! On 17 feb, 09:53, bruno desthuilliers wrote: > On Feb 16, 3:13 pm, Sander wrote: > > > > > Hello everybody, > > > I'm kinda new to Django, and just finished reading the Django book. > > Now I was wondering the following when it comes t

Re: Multiple user types

2010-02-17 Thread bruno desthuilliers
On Feb 16, 3:13 pm, Sander wrote: > Hello everybody, > > I'm kinda new to Django, and just finished reading the Django book. > Now I was wondering the following when it comes to user management. > > In the Django documentation I found that storing additional > information is acomplished by writing