Multiply nutritional values by number of portions
Closed this issue · 1 comments
MarcusWolschon commented
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
Recipes state the nutritonal values per serving but Tandoor expects them to be for the entire meal and does scale them up/down when a different number of services is to be cooked
Describe alternatives you've considered
No response
Additional context
No response
Contribute
- Yes
- Partly
- No
MarcusWolschon commented
You can convert existing Database entries by:
psql
list databases
\l
connect to database
\c Tandoor
list tables
\dt
update:
UPDATE cookbook_nutritioninformation as n
SET fats = n.fats * r.servings , carbohydrates = n.carbohydrates * r.servings, proteins = n.proteins * r.servings, calories = n.calories * r.servings
FROM cookbook_recipe AS r
WHERE r.nutrition_id = n.id;
exit
\q