Wednesday, July 7, 2021

Implementing different user types for one project


I have a project with Artists, Bands and Site Members.

All the above user types share some basics such as ability to login and create profiles. Artists and Bands can have some admin privileges.

How do I best model these users? I was considering the following:
  1. Extend auth User. This would create extra database load with lookups (e.g. fetching profile users connected to default User)
  2. Subclass AbstractUser. This requires me to specify one auth user in settings. How would I handle that when I have three user types to consider?
I was thinking, I could create a class SiteUser(AbstractUser) and then, for seach separate user type - Artist, Band, Site Member, subclass SiteUser and set my auth user to SiteUser. Thoughts please?

TIA.

--
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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/80c7ee78-6084-46ec-b883-e897ebeb9a8an%40googlegroups.com.

No comments:

Post a Comment