summaryrefslogtreecommitdiff
path: root/kitchen/management
diff options
context:
space:
mode:
Diffstat (limited to 'kitchen/management')
-rw-r--r--kitchen/management/commands/seed.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/kitchen/management/commands/seed.py b/kitchen/management/commands/seed.py
index 522e178..d79adf6 100644
--- a/kitchen/management/commands/seed.py
+++ b/kitchen/management/commands/seed.py
@@ -94,14 +94,15 @@ class Command(BaseCommand):
# --- Pantry Items (from current Pantry.md as of 31 Mar 2026) ---
self.stdout.write("Creating pantry items...")
- def add_pantry(name, qty, unit, location, expiry=None, is_staple=False, notes=""):
+ def add_pantry(name, qty, unit, location, expiry=None, is_staple=False, notes="", state="in"):
# Use ingredient + location for lookup so same ingredient can exist
# in multiple locations (e.g. sausages in fridge AND freezer)
PantryItem.objects.get_or_create(
ingredient=ingredients[name],
location=location,
defaults={
- "quantity": Decimal(str(qty)),
+ "state": state,
+ "quantity": int(qty),
"unit": unit,
"expiry_date": expiry,
"is_staple": is_staple,
@@ -132,7 +133,7 @@ class Command(BaseCommand):
add_pantry(name, 1, "n/a", "cupboard", is_staple=True)
# Out of stock (for reference)
- add_pantry("eggs", 0, "items", "fridge", notes="OUT — restock")
+ add_pantry("eggs", 0, "items", "fridge", notes="OUT — restock", state="out")
add_pantry("baked beans", 1, "tins", "cupboard")
add_pantry("freezer bags", 1, "boxes", "cupboard")