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:
@@ -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
@@ -27,6 +27,11 @@ class Ingredient(models.Model):
|
|||||||
aliases = models.JSONField(
|
aliases = models.JSONField(
|
||||||
default=list, blank=True, help_text='Alternative names, e.g. ["noodles", "egg noodle nests"]'
|
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:
|
class Meta:
|
||||||
ordering = ["name"]
|
ordering = ["name"]
|
||||||
@@ -210,7 +215,12 @@ class CookLog(models.Model):
|
|||||||
help_text='Slot choices for meta-recipe, e.g. {"protein": "pork mince", "carb": "noodles"}',
|
help_text='Slot choices for meta-recipe, e.g. {"protein": "pork mince", "carb": "noodles"}',
|
||||||
)
|
)
|
||||||
servings = models.IntegerField(default=2)
|
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:
|
class Meta:
|
||||||
ordering = ["-date"]
|
ordering = ["-date"]
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class IngredientSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Ingredient
|
model = Ingredient
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
# preferences field included via __all__
|
||||||
|
|
||||||
|
|
||||||
class PantryItemSerializer(serializers.ModelSerializer):
|
class PantryItemSerializer(serializers.ModelSerializer):
|
||||||
|
|||||||
Reference in New Issue
Block a user