Merge pull request #377 from faassen/patch-1

Adjustments to make it work with Django 2.0.1
This commit is contained in:
Syrus Akbary 2018-01-20 16:17:47 -08:00 committed by GitHub
commit e05f069b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,8 @@ 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
@ -80,7 +81,7 @@ Add ingredients as INSTALLED_APPS:
INSTALLED_APPS = [
...
# Install the ingredients app
'ingredients',
'cookbook.ingredients',
]
Don't forget to create & run migrations: