I have two models like this:
class Type1Profile(models.Model): user = models.OneToOneField(User, unique=True) ... class Type2Profile(models.Model):
To check if the (OneToOne) relation exists or not, you can use the hasattr function:
hasattr
if hasattr(request.user, 'type1profile'): # do something elif hasattr(request.user, 'type2profile'): # do something else else: # do something else