This commit is contained in:
2025-10-01 16:12:44 -07:00
parent bb30f9eb2b
commit 7cbc2d83bb
5 changed files with 206 additions and 33 deletions

View File

@@ -228,10 +228,10 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non
'num_servings': num_servings,
'serving_size': mf.food.serving_size,
'serving_unit': mf.food.serving_unit,
'calories': mf.food.calories * num_servings,
'protein': mf.food.protein * num_servings,
'carbs': mf.food.carbs * num_servings,
'fat': mf.food.fat * num_servings,
'calories': (mf.food.calories or 0) * num_servings,
'protein': (mf.food.protein or 0) * num_servings,
'carbs': (mf.food.carbs or 0) * num_servings,
'fat': (mf.food.fat or 0) * num_servings,
'fiber': (mf.food.fiber or 0) * num_servings,
'sodium': (mf.food.sodium or 0) * num_servings,
})
@@ -317,10 +317,10 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non
'num_servings': num_servings,
'serving_size': mf.food.serving_size,
'serving_unit': mf.food.serving_unit,
'calories': mf.food.calories * num_servings,
'protein': mf.food.protein * num_servings,
'carbs': mf.food.carbs * num_servings,
'fat': mf.food.fat * num_servings,
'calories': (mf.food.calories or 0) * num_servings,
'protein': (mf.food.protein or 0) * num_servings,
'carbs': (mf.food.carbs or 0) * num_servings,
'fat': (mf.food.fat or 0) * num_servings,
'fiber': (mf.food.fiber or 0) * num_servings,
'sodium': (mf.food.sodium or 0) * num_servings,
})
@@ -339,10 +339,10 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non
'num_servings': num_servings,
'serving_size': tracked_food.food.serving_size,
'serving_unit': tracked_food.food.serving_unit,
'calories': tracked_food.food.calories * num_servings,
'protein': tracked_food.food.protein * num_servings,
'carbs': tracked_food.food.carbs * num_servings,
'fat': tracked_food.food.fat * num_servings,
'calories': (tracked_food.food.calories or 0) * num_servings,
'protein': (tracked_food.food.protein or 0) * num_servings,
'carbs': (tracked_food.food.carbs or 0) * num_servings,
'fat': (tracked_food.food.fat or 0) * num_servings,
'fiber': (tracked_food.food.fiber or 0) * num_servings,
'sodium': (tracked_food.food.sodium or 0) * num_servings,
})
@@ -403,10 +403,10 @@ async def detailed(request: Request, person: str = "Sarah", plan_date: str = Non
'num_servings': num_servings,
'serving_size': mf.food.serving_size,
'serving_unit': mf.food.serving_unit,
'calories': mf.food.calories * num_servings,
'protein': mf.food.protein * num_servings,
'carbs': mf.food.carbs * num_servings,
'fat': mf.food.fat * num_servings,
'calories': (mf.food.calories or 0) * num_servings,
'protein': (mf.food.protein or 0) * num_servings,
'carbs': (mf.food.carbs or 0) * num_servings,
'fat': (mf.food.fat or 0) * num_servings,
'fiber': (mf.food.fiber or 0) * num_servings,
'sodium': (mf.food.sodium or 0) * num_servings,
})