Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converting a model to multi-table inheritance in Django - Initial Model Structure
class Address(models.Model):
name = models.CharField(max_length=20)
owner = models.ForeignKey('another_app.Owner')
class Meta:
abstract = True
class HomeAddress(Address):
housekeeper = models.CharField(max_length=50)
class WorkAddress(Address):
boss = models.CharField(max_length=50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.