-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
feat: Add the ability to flag a food as "on hand", to exclude from shopping list #3777
feat: Add the ability to flag a food as "on hand", to exclude from shopping list #3777
Conversation
@@ -144,12 +146,15 @@ class IngredientFoodModel(SqlAlchemyBase, BaseMixins): | |||
name: Mapped[str | None] = mapped_column(String) | |||
plural_name: Mapped[str | None] = mapped_column(String) | |||
description: Mapped[str | None] = mapped_column(String) | |||
on_hand: Mapped[bool] = mapped_column(Boolean) |
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.
This is the only actual functional change in this file
@@ -36,6 +36,7 @@ class UnitFoodBase(MealieModel): | |||
plural_name: str | None = None | |||
description: str = "" | |||
extras: dict | None = {} | |||
on_hand: bool = 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.
This is the only actual functional change in this file
LGTM, besides the one comment I had. Once this is ready I'll pull it locally and test it out, but reviewing the dif looks good |
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.
Functionality looks great. A few UI things which I think will make it look more in line with other similar data features
Changes made @michael-genson; good suggestions! |
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.
👍
What type of PR is this?
What this PR does / why we need it:
Adds the ability to mark a food as "on hand" (terminology taken from tools). Then when adding a recipe to a shopping list, on hand foods will be unticked by default. Current behaviour is that every ingredient is ticked by default. The intent is to use this for your staple ingredients that you rarely need to buy, sugar, salt, spices, rice, ...
Don't ask me how this recipe would turn out!! 🙈
Which issue(s) this PR fixes:
None.
Special notes for your reviewer:
I think the change is fairly straight forward. There are a couple files that had a lot of formatting updates applied, so I've put some comments to indicate the small change actually made in there.
Testing
Locally, with SQLite.