Last active
May 1, 2020 06:58
-
-
Save hiimdoublej/9318c144b151890fd79f56202096b962 to your computer and use it in GitHub Desktop.
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 Owner(models.Model): | |
name = models.CharField(max_length=50) | |
def __str__(self): | |
return self.name | |
class Shop(models.Model): | |
name = models.CharField(max_length=50) | |
address = models.CharField(max_length=255) | |
owner = models.ForeignKey(Owner, on_delete=models.CASCADE) | |
def __str__(self): | |
return self.name | |
class Item(models.Model): | |
name = models.CharField(max_length=50) | |
description = models.TextField() | |
shop = models.ForeignKey(Shop, on_delete=models.CASCADE) | |
def __str__(self): | |
return self.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment