From 718475794a5b5d96f7d092c5d675d9c72068b8fb Mon Sep 17 00:00:00 2001 From: Chouaib Lammas <54365321+chlammas@users.noreply.github.com> Date: Sun, 5 Sep 2021 15:42:50 +0000 Subject: [PATCH] Fix ingredient model Add the required positional argument: 'on_delete' --- docs/tutorial-relay.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial-relay.rst b/docs/tutorial-relay.rst index acc4b0d..3de9022 100644 --- a/docs/tutorial-relay.rst +++ b/docs/tutorial-relay.rst @@ -70,7 +70,7 @@ Let's get started with these models: class Ingredient(models.Model): name = models.CharField(max_length=100) notes = models.TextField() - category = models.ForeignKey(Category, related_name='ingredients') + category = models.ForeignKey(Category, related_name='ingredients', on_delete=models.CASCADE) def __str__(self): return self.name