Sounds pretty straight forward. gonna try it out. Thanks!
On 17 feb, 09:53, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On Feb 16, 3:13 pm, Sander <sander.garret...@gmail.com> 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 a new model and add a foreign > > key to the user. > > Then in the settings file add a reference to the model by adding: > > AUTH_PROFILE_MODULE = 'app.UserProfileModel' > > > So far, so good. But now I want to have two (or more) user types on my > > site with each their additional info. lets say I have a user > > representing a Teacher wich I want to store the additional info 'age, > > gender, experience_years' AND a user representing a student which I > > want to give the additional info 'student number, class'. > > I solved this using a BaseProfile model and specific "user type" > models inheriting from BaseProfile. It can be a bit of a PITA > sometimes - you'll have to do stuff like > user.get_profile().student.student_number or > user.get_profile().teacher.gender - but it works. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.