mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-14 13:47:12 +03:00
Fix ingredient model (#1258)
Add the required positional argument: 'on_delete'
This commit is contained in:
parent
1e4b03b975
commit
ef9d67302e
|
@ -70,7 +70,7 @@ Let's get started with these models:
|
||||||
class Ingredient(models.Model):
|
class Ingredient(models.Model):
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
notes = models.TextField()
|
notes = models.TextField()
|
||||||
category = models.ForeignKey(Category, related_name='ingredients')
|
category = models.ForeignKey(Category, related_name='ingredients', on_delete=models.CASCADE)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
Loading…
Reference in New Issue
Block a user