From 850a9efaa3e1899f533d09e07f113872c6b9b3f6 Mon Sep 17 00:00:00 2001 From: sstent Date: Mon, 29 Sep 2025 10:21:21 -0700 Subject: [PATCH] sync - build workin --- main.py | 5 +++++ templates/detailed.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index fbf7750..e59f629 100644 --- a/main.py +++ b/main.py @@ -1810,6 +1810,8 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non 'protein': mf.food.protein * mf.quantity, 'carbs': mf.food.carbs * mf.quantity, 'fat': mf.food.fat * mf.quantity, + 'fiber': mf.food.fiber * mf.quantity, + 'sodium': mf.food.sodium * mf.quantity, }) meal_details.append({ @@ -2179,6 +2181,9 @@ async def test_route(): @app.get("/templates", response_class=HTMLResponse) async def templates_page(request: Request, db: Session = Depends(get_db)): templates_list = db.query(Template).all() + logging.info(f"DEBUG: templates_list contains {len(templates_list)} templates.") + for t in templates_list: + logging.info(f"DEBUG: Template object: {t.__dict__}") meals = db.query(Meal).all() return templates.TemplateResponse(request, "templates.html", {"templates": templates_list, "meals": meals}) diff --git a/templates/detailed.html b/templates/detailed.html index 2588753..d705dbc 100644 --- a/templates/detailed.html +++ b/templates/detailed.html @@ -180,8 +180,8 @@ {{ "%.1f"|format(meal_food.protein) }}g {{ "%.1f"|format(meal_food.carbs) }}g {{ "%.1f"|format(meal_food.fat) }}g - {{ "%.1f"|format(meal_food.fiber or 0) }}g - {{ "%.0f"|format(meal_food.sodium or 0) }}mg + {{ "%.1f"|format(meal_food['fiber']|float) }}g + {{ "%.0f"|format(meal_food['sodium']|float) }}mg {% endfor %}