Created
July 12, 2017 12:04
-
-
Save ebsaral/2527eba7aebcb98ee97c995f5233d468 to your computer and use it in GitHub Desktop.
Converting a model to multi-table inheritance in Django - Initial Model Structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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