title: Django: Allow choice of many OneToOneFields
body: <p>I am creating a system whereby the user can have one of 3 account types (Musician, Blogger or Listener). I have accomplished this but I am not sure this is the best way to go about it. </p>
  
  <h2>Current Solution</h2>
  
  <p>In the current system I have a custom user model with a CharField <code>account_type</code> that has a choices attribute of <code>'M', 'L', or 'B'</code> for the three account_types. There are three models for Blogger, Musician and Listener. I use signals to assign the account_type after account creation.</p>
  
  <p>User Model:</p>
  
  <pre><code>class User(AbstractBaseUser, PermissionsMixin):
      """
      A copy of the django default user model with additional account_type and email used as username.
  
      Password, account_type and email are required. Other fields are optional.
      """
      ACCOUNT_TYPES = (
          ('M', 'Musician'),
          ('B', 'Blogger'),
          ('L', 'Listener')
      )
      first_name = models.CharField(max_length=30, blank=True)
      last_name = models.CharField(max_length=30, blank=True)
      email = models.EmailField(unique=True)
      account_type = models.CharField(max_length=1, choices=ACCOUNT_TYPES, default='L')
      ...
  </code></pre>
  
  <p>Receivers.py:</p>
  
  <pre><code>@receiver(post_save, sender=User, dispatch_uid='associate_account_type_post_save')
  def post_save_receiver(sender, instance, created, **kwargs):
      if created:
          AccountType(instance).associate(instance.account_type)
  
  
  @receiver(user_signed_up)
  def user_signed_up_receiver(request, user, **kwargs):
      AccountType(user).associate(user.account_type)
  </code></pre>
  
  <p><code>AccountType(user).associate(account_type)</code> is a helper function that first checks if the user has a relation to one of the account types, deletes it if so and then creates the new relation. I don't think the code for that is relevant to the question so have not included.</p>
  
  <p>The two receivers are required because of the use of allauth. Since I have added a column to the User model I also created a custom form with the account_type choices field. Allauth triggers the <code>user_signed_up</code> signal after two saves; first the model is created with the standard form fields, then the custom form fields are saved. I have to use the post_save signal as well to make sure that the relation I also set when the user is created through Django's admin interface.</p>
  
  <h2>Alternative solution</h2>
  
  <p>It would be good not to have two receivers that ultimately have the same function and not to have a column that is redundant. A good alternative would be to have a field within the user model that does not have a corresponding column but a corresponding relation. Therefore, no string of <code>'M', 'B', or 'L'</code> is saved to the database but a relationship is automatically created. </p>
  
  <p>This way one can query whether the user is a musician simply by <code>User.musician</code> and catching a <code>DoesNotExist</code> exception.</p>
  
  <p>The only method I can think of to accomplish this is if the request were included in signals. That way I could have the same receiver and just replace <code>user.account_type</code> with <code>request.cleaned_data['account_type']</code>.</p>
  
  <p>I am not sure if this can be accomplished in Django and hope someone can enlighten me.</p>