mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-26 04:05:11 -05:00
feat: Structured Yields (#4489)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
@@ -89,7 +89,8 @@ class RecipeModel(SqlAlchemyBase, BaseMixins):
|
||||
cook_time: Mapped[str | None] = mapped_column(sa.String)
|
||||
|
||||
recipe_yield: Mapped[str | None] = mapped_column(sa.String)
|
||||
recipeCuisine: Mapped[str | None] = mapped_column(sa.String)
|
||||
recipe_yield_quantity: Mapped[float] = mapped_column(sa.Float, index=True, default=0)
|
||||
recipe_servings: Mapped[float] = mapped_column(sa.Float, index=True, default=0)
|
||||
|
||||
assets: Mapped[list[RecipeAsset]] = orm.relationship("RecipeAsset", cascade="all, delete-orphan")
|
||||
nutrition: Mapped[Nutrition] = orm.relationship("Nutrition", uselist=False, cascade="all, delete-orphan")
|
||||
@@ -131,7 +132,6 @@ class RecipeModel(SqlAlchemyBase, BaseMixins):
|
||||
notes: Mapped[list[Note]] = orm.relationship("Note", cascade="all, delete-orphan")
|
||||
org_url: Mapped[str | None] = mapped_column(sa.String)
|
||||
extras: Mapped[list[ApiExtras]] = orm.relationship("ApiExtras", cascade="all, delete-orphan")
|
||||
is_ocr_recipe: Mapped[bool | None] = mapped_column(sa.Boolean, default=False)
|
||||
|
||||
# Time Stamp Properties
|
||||
date_added: Mapped[date | None] = mapped_column(sa.Date, default=get_utc_today)
|
||||
@@ -167,6 +167,10 @@ class RecipeModel(SqlAlchemyBase, BaseMixins):
|
||||
},
|
||||
)
|
||||
|
||||
# Deprecated
|
||||
recipeCuisine: Mapped[str | None] = mapped_column(sa.String)
|
||||
is_ocr_recipe: Mapped[bool | None] = mapped_column(sa.Boolean, default=False)
|
||||
|
||||
@validates("name")
|
||||
def validate_name(self, _, name):
|
||||
assert name != ""
|
||||
|
||||
Reference in New Issue
Block a user