Suppose there is an abstract model CarOwner: whereas a Person or a Business can be a CarOwner. In addition a Car with a certain VIN can belong (relate) to either a Person or a Business, but not both (mutually exclusive case). At the very end of the following code I presented two possibilities (see comments in the code "# 1. SHOULD I HAVE THIS???" and "# 2. ...OR SHOULD I HAVE THIS???"). In the first possibility a Many-to-One relationship is established to an abstract model and I am not sure if this is the right way. In the second case two relationships are established and I am not sure if that is correct either, especially it is not clear how to make them mutually exclusive. So which one is right and if neither, please, provide the right answer if you could. Thanks.
class CarOwner(models.Model):
location = models.CharField(max_length=50, blank=True)
class Meta:
abstract = True
class Person(CarOwner):
name = models.CharField(max_length=50, blank=True)
class Business(CarOwner):
business_id = models.CharField(max_length=50, blank=True)
class Car(models.Model):
vin = models.CharField(max_length=50, blank=True)
# 1. SHOULD I HAVE THIS??? (CarOwner is abstract)
carowner = models.ForeignKey(CarOwner, blank=True, null=True)
# 2. ...OR SHOULD I HAVE THIS???
person = models.ForeignKey(Person, blank=True, null=True)
business = models.ForeignKey(Business, blank=True, null=True)