Add rating + preferences fields, log first cook feedback

- Ingredient.preferences: qualitative notes on how Tom likes things cooked
- CookLog.rating: 1-5 score
- CookLog.notes: help text updated for feedback
- Migration 0002
- First cook logged: Baked Pasta with lardons, rated 2/5
- Bacon lardons preference: don't oven bake, fry separately, not solo protein
This commit is contained in:
Caine
2026-04-02 22:50:49 +01:00
parent 189d72b797
commit 75e3256eae
3 changed files with 40 additions and 1 deletions
@@ -0,0 +1,28 @@
# Generated by Django 5.2.12 on 2026-04-02 21:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kitchen', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='cooklog',
name='rating',
field=models.IntegerField(blank=True, help_text='1-5 rating. 1=awful, 3=fine, 5=great', null=True),
),
migrations.AddField(
model_name='ingredient',
name='preferences',
field=models.TextField(blank=True, help_text='How Tom likes this ingredient cooked / qualitative notes. E.g. "Don\'t traybake — needs to be fried. Not substantial as sole protein."'),
),
migrations.AlterField(
model_name='cooklog',
name='notes',
field=models.TextField(blank=True, help_text="What worked, what didn't, what to change next time"),
),
]
+11 -1
View File
@@ -27,6 +27,11 @@ class Ingredient(models.Model):
aliases = models.JSONField(
default=list, blank=True, help_text='Alternative names, e.g. ["noodles", "egg noodle nests"]'
)
preferences = models.TextField(
blank=True,
help_text="How Tom likes this ingredient cooked / qualitative notes. "
'E.g. "Don\'t traybake — needs to be fried. Not substantial as sole protein."',
)
class Meta:
ordering = ["name"]
@@ -210,7 +215,12 @@ class CookLog(models.Model):
help_text='Slot choices for meta-recipe, e.g. {"protein": "pork mince", "carb": "noodles"}',
)
servings = models.IntegerField(default=2)
notes = models.TextField(blank=True)
rating = models.IntegerField(
null=True,
blank=True,
help_text="1-5 rating. 1=awful, 3=fine, 5=great",
)
notes = models.TextField(blank=True, help_text="What worked, what didn't, what to change next time")
class Meta:
ordering = ["-date"]
+1
View File
@@ -29,6 +29,7 @@ class IngredientSerializer(serializers.ModelSerializer):
class Meta:
model = Ingredient
fields = "__all__"
# preferences field included via __all__
class PantryItemSerializer(serializers.ModelSerializer):