-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to log complete nutritional plan #506
Comments
If this is still open, I'd like to take a crack at it. |
Is the plan to place a button on the "Nutrition plan" view to log the entire plan? If so, how does the total calories get logged? I see similar logic in the NutritionPlan's get_nutritional_values method; it appears that the method iterates over the meals and sums up all of the values. Is this doing what this ticket is describing or is this similar code that needs to be refactored? |
Yes it should be placed there. The calories are summed by the log and the plan, you only need to add the ingredients and units (e.g. 100g of bread, 2 slices of cheese, etc) Take a look at wger/wger/nutrition/views/log.py Line 117 in 88c28bf
|
Awsome! I'll take a look at it today. |
Nice work! You can open a PR after updating the tests |
Pull request #540 is now available |
I'm participating in Hacktoberfest. According to the site this project is not participating. I was wondering if a maintainer could add the "hacktoberfest-accepted" label to the PR. This way the whole project doesn't have to participate and I can get credit. If you'd like to have the project participate, a maintainer can add the topic "hacktoberfest" to the project If not, no worries, I was happy to help with this project. |
Hacktoberfest, I completely forgot about that! I'll clean up the issues a bit and add the tag |
At the moment, it is possible to log all entries for a meal. It should also be possible to log the calories for all meals for a day.
This is really simple, instead of just adding the ingredients for a meal, we need to loop through all meals in a plan and add those (since this will duplicade code, a bit of refactoring will be needed as well).
The text was updated successfully, but these errors were encountered: