diff --git a/cookbook/migrations/0070_auto_20200701_2007.py b/cookbook/migrations/0070_auto_20200701_2007.py new file mode 100644 index 00000000..4a6783df --- /dev/null +++ b/cookbook/migrations/0070_auto_20200701_2007.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.7 on 2020-07-01 18:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0069_auto_20200629_2134'), + ] + + operations = [ + migrations.AddField( + model_name='step', + name='time', + field=models.IntegerField(blank=True, default=0), + ), + migrations.AlterField( + model_name='step', + name='kind', + field=models.CharField(choices=[('TEXT', 'Text'), ('TIME', 'Time')], default='TEXT', max_length=16), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index de087b85..b438ee70 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -160,11 +160,13 @@ class Ingredient(models.Model): class Step(models.Model): TEXT = 'TEXT' + TIME = 'TIME' name = models.CharField(max_length=128, default='', blank=True) - kind = models.CharField(choices=((TEXT, _('Text')),), default=TEXT, max_length=16) + kind = models.CharField(choices=((TEXT, _('Text')), (TIME, _('Time')),), default=TEXT, max_length=16) instruction = models.TextField(blank=True) ingredients = models.ManyToManyField(Ingredient, blank=True) + time = models.IntegerField(default=0, blank=True) order = models.IntegerField(default=0) class Meta: diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 6179c675..98b7f3b2 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -38,7 +38,6 @@