From 0b3b3446696b75d79d367975814cdc72d2e52ac2 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 19 Feb 2020 13:09:25 +0100 Subject: [PATCH] Renamed UsedIngredients to UsedIngredient --- food_planner/migrations/0001_initial.py | 4 ++-- food_planner/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/food_planner/migrations/0001_initial.py b/food_planner/migrations/0001_initial.py index 4067adf..75b9570 100644 --- a/food_planner/migrations/0001_initial.py +++ b/food_planner/migrations/0001_initial.py @@ -66,7 +66,7 @@ class Migration(migrations.Migration): ], ), migrations.CreateModel( - name='UsedIngredients', + name='UsedIngredient', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('amount', models.PositiveIntegerField(help_text='Please specify the used amount of the ingredient', verbose_name='Amount')), @@ -88,7 +88,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='recipe', name='ingredients', - field=models.ManyToManyField(through='food_planner.UsedIngredients', to='food_planner.Ingredient'), + field=models.ManyToManyField(through='food_planner.UsedIngredient', to='food_planner.Ingredient'), ), migrations.AddField( model_name='recipe', diff --git a/food_planner/models.py b/food_planner/models.py index cef61fc..7a16ce3 100644 --- a/food_planner/models.py +++ b/food_planner/models.py @@ -59,7 +59,7 @@ class Recipe(models.Model): author = models.ForeignKey(User, models.SET_NULL, null=True) kitchen_utilities = models.ManyToManyField(KitchenUtility, through='UsedKitchenUtilities') - ingredients = models.ManyToManyField(Ingredient, through='UsedIngredients') + ingredients = models.ManyToManyField(Ingredient, through='UsedIngredient') name = models.CharField(_('Name'), max_length=255) image = models.ImageField(_('Image'), blank=True, null=True) @@ -104,7 +104,7 @@ class UsedKitchenUtilities(models.Model): default=1) -class UsedIngredients(models.Model): +class UsedIngredient(models.Model): recipe = models.ForeignKey(Recipe, models.CASCADE) ingredient = models.ForeignKey(Ingredient, models.CASCADE) amount = models.PositiveIntegerField(_('Amount'),