From 78d5ffc8f31cdd11517009d7fc2ed537f2224815 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sun, 23 Feb 2020 14:21:37 +0100 Subject: [PATCH] Added order with respect to --- .../migrations/0006_auto_20200223_1331.py | 25 +++++++++++++++++++ food_planner/models.py | 3 +-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 food_planner/migrations/0006_auto_20200223_1331.py diff --git a/food_planner/migrations/0006_auto_20200223_1331.py b/food_planner/migrations/0006_auto_20200223_1331.py new file mode 100644 index 0000000..f4df91e --- /dev/null +++ b/food_planner/migrations/0006_auto_20200223_1331.py @@ -0,0 +1,25 @@ +# Generated by Django 3.0.3 on 2020-02-23 12:31 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('food_planner', '0005_auto_20200223_1317'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='recipestep', + unique_together=set(), + ), + migrations.AlterOrderWithRespectTo( + name='recipestep', + order_with_respect_to='recipe', + ), + migrations.RemoveField( + model_name='recipestep', + name='number_of_step', + ), + ] diff --git a/food_planner/models.py b/food_planner/models.py index f436690..4bb155e 100644 --- a/food_planner/models.py +++ b/food_planner/models.py @@ -125,12 +125,11 @@ class RecipeStep(models.Model): recipe = models.ForeignKey(Recipe, models.CASCADE) image = models.ImageField(_('Image'), blank=True, null=True) description = models.TextField(_('Description')) - number_of_step = models.PositiveIntegerField(_('Number of step')) class Meta: - unique_together = ['recipe', 'number_of_step'] verbose_name = _('Recipe step') verbose_name_plural = _('Recipe steps') + order_with_respect_to = 'recipe' class UsedKitchenUtility(models.Model):