-
-
Notifications
You must be signed in to change notification settings - Fork 584
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 foreign key to meals on log #842
Conversation
wger/nutrition/models/meal.py
Outdated
null=True, | ||
on_delete=models.SET_NULL, | ||
related_name="meals" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The foreign key should be in the logs, sorry if it wasn't very clear. Then in _logMealPlan you can simply set the current meal when creating the LogItem instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay okay. sorry my bad i'll get it sorted
I'll review this later today or tomorrow at the latest |
cf0838f
to
9eaedea
Compare
wger/nutrition/forms.py
Outdated
@@ -263,13 +263,15 @@ def __init__(self, *args, **kwargs): | |||
|
|||
|
|||
class MealLogItemForm(MealItemForm): | |||
meal = forms.ModelChoiceField(queryset=Meal.objects.all(), required=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, now that I'm thinking about it, better remove the meal from this form, then I can merge the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
Proposed Changes
log_item
toMeals
model inside nutritionlogitems
upon creating logs.Please check that the PR fulfills these requirements
Other questions
(e.g. database migration)?
#819