From f4506d8a7e04a7a403c619a52431ff8db4ac5f68 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 19 Feb 2020 13:21:06 +0100 Subject: [PATCH] Renamed StoredIngredients to StoredIngredient --- 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 75b9570..9a686e2 100644 --- a/food_planner/migrations/0001_initial.py +++ b/food_planner/migrations/0001_initial.py @@ -76,7 +76,7 @@ class Migration(migrations.Migration): ], ), migrations.CreateModel( - name='StoredIngredients', + name='StoredIngredient', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('amount', models.PositiveIntegerField(help_text='Please specify the stored amount of the ingredient', verbose_name='Amount')), @@ -122,7 +122,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='pantry', name='ingredients', - field=models.ManyToManyField(through='food_planner.StoredIngredients', to='food_planner.Ingredient'), + field=models.ManyToManyField(through='food_planner.StoredIngredient', to='food_planner.Ingredient'), ), migrations.AddField( model_name='pantry', diff --git a/food_planner/models.py b/food_planner/models.py index 7a16ce3..f79fc63 100644 --- a/food_planner/models.py +++ b/food_planner/models.py @@ -136,7 +136,7 @@ class Product(models.Model): class Pantry(models.Model): owner = models.ForeignKey(User, models.CASCADE) - ingredients = models.ManyToManyField(Ingredient, through='StoredIngredients') + ingredients = models.ManyToManyField(Ingredient, through='StoredIngredient') def __str__(self): return format_lazy('Pantry of {firstName} {lastName}', @@ -144,7 +144,7 @@ class Pantry(models.Model): lastName=self.owner.last_name) -class StoredIngredients(models.Model): +class StoredIngredient(models.Model): pantry = models.ForeignKey(Pantry, models.CASCADE) ingredient = models.ForeignKey(Ingredient, models.CASCADE) amount = models.PositiveIntegerField(_('Amount'),