What's the difference between OneToOne and Subclassing a model in Django

django, django-models, python

Solution

Models with a `OneToOne` have an independent PK; submodels always use the PK of their supermodel.

Problem

For example: ``` class Subdomain(Site): #fields here ``` and ``` class Subdomain(models.Model): site = models.OneToOne(Site) #fields here ```

Original source