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:
@@ -91,6 +91,8 @@ class RecipeSummary(MealieModel):
|
||||
name: str | None = None
|
||||
slug: Annotated[str, Field(validate_default=True)] = ""
|
||||
image: Any | None = None
|
||||
recipe_servings: float = 0
|
||||
recipe_yield_quantity: float = 0
|
||||
recipe_yield: str | None = None
|
||||
|
||||
total_time: str | None = None
|
||||
@@ -122,6 +124,10 @@ class RecipeSummary(MealieModel):
|
||||
|
||||
return val
|
||||
|
||||
@property
|
||||
def recipe_yield_display(self) -> str:
|
||||
return f"{self.recipe_yield_quantity} {self.recipe_yield}".strip()
|
||||
|
||||
@classmethod
|
||||
def loader_options(cls) -> list[LoaderOption]:
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user