Skip to content

Instantly share code, notes, and snippets.

@katiayn
Created January 28, 2018 21:43
Show Gist options
  • Save katiayn/132e6d2f01d7a84428ca069265fa7db8 to your computer and use it in GitHub Desktop.
Save katiayn/132e6d2f01d7a84428ca069265fa7db8 to your computer and use it in GitHub Desktop.
class Property(models.Model):
price = models.DecimalField(max_digits=15, decimal_places=2)
rooms = models.PositiveIntegerField()
address = models.TextField(null=True, blank=True)
city = models.CharField(max_length=255)
country = models.CharField(max_length=255)
class Meta:
abstract = True
class House(Property):
pass
class Apartment(Property):
floor = models.PositiveIntegerField()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment