I am trying to create an intranet/extranet with internal/external user-specific profiles, with a common generic profile. I’ve looked at several answers on this site, but none specifically address what I’m looking to do. Below are the (stripped down) files I have so far.
What’s the best way to create a profile model, with subprofiles for each user type? I’m trying not to require a custom authentication backend if at all possible.
You need a combination of storing additional information about users and model inheritance.
Basically, you’ll need the generic
Usermodels we all know and either love or hate, and then you need a generic profile model that is yourAUTH_PROFILE_MODULEsetting.That profile model will be a top-level model, with model subclasses for internal and extrernal users. You probably don’t want an abstract model in this case since you’ll need a common profile table to load user profiles from with
User.get_profile().So…I think the major thing you want to change is to make your Associate, External, etc. models inherit from your Profile model.