added ability to link recipes to ingredients

This commit is contained in:
vabene1111
2020-03-17 18:44:11 +01:00
parent a60b09e491
commit 90dbc36402
10 changed files with 94 additions and 6 deletions

View File

@ -127,6 +127,7 @@ class Unit(models.Model):
class Ingredient(models.Model):
name = models.CharField(unique=True, max_length=128)
recipe = models.ForeignKey(Recipe, null=True, blank=True, on_delete=models.SET_NULL)
def __str__(self):
return self.name