diff --git a/cookbook/migrations/0097_auto_20210113_1315.py b/cookbook/migrations/0097_auto_20210113_1315.py new file mode 100644 index 00000000..97861c87 --- /dev/null +++ b/cookbook/migrations/0097_auto_20210113_1315.py @@ -0,0 +1,25 @@ +# Generated by Django 3.1.5 on 2021-01-13 12:15 + +import datetime +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0096_auto_20210109_2044'), + ] + + operations = [ + migrations.AddField( + model_name='recipe', + name='description', + field=models.CharField(blank=True, max_length=512, null=True), + ), + migrations.AlterField( + model_name='food', + name='name', + field=models.CharField(max_length=128, unique=True, validators=[django.core.validators.MinLengthValidator(1)]), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index 7f5ae974..4387d3ad 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -248,6 +248,7 @@ class NutritionInformation(models.Model): class Recipe(models.Model): name = models.CharField(max_length=128) + description = models.CharField(max_length=512, blank=True, null=True) servings = models.IntegerField(default=1) image = models.ImageField(upload_to='recipes/', blank=True, null=True) storage = models.ForeignKey( diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 32fec231..7f39e56d 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -189,7 +189,7 @@ class RecipeSerializer(WritableNestedModelSerializer): class Meta: model = Recipe fields = ( - 'id', 'name', 'image', 'keywords', 'steps', 'working_time', + 'id', 'name', 'description', 'image', 'keywords', 'steps', 'working_time', 'waiting_time', 'created_by', 'created_at', 'updated_at', 'internal', 'nutrition', 'servings', 'file_path' ) diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 2f7f4307..66b23038 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -83,6 +83,19 @@ + +
+
+ + + +
+ +
+ +