mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-11 12:55:15 -05:00
Feature/additional endpoints (#257)
* new recipe summary route * add categories to cards * add pillow * show tags instead of categories * additional debug info * add todays meal image url * about page * fix reactive tag * changelog + docs * bump version Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
from pathlib import Path
|
||||
from fastapi_camelcase import CamelModel
|
||||
|
||||
|
||||
class AppInfo(CamelModel):
|
||||
production: bool
|
||||
version: str
|
||||
demo_status: bool
|
||||
|
||||
class DebugInfo(AppInfo):
|
||||
api_port: int
|
||||
api_docs: bool
|
||||
db_type: str
|
||||
sqlite_file: Path
|
||||
default_group: str
|
||||
@@ -34,12 +34,30 @@ class Nutrition(BaseModel):
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class Recipe(BaseModel):
|
||||
class RecipeSummary(BaseModel):
|
||||
name: str
|
||||
description: Optional[str]
|
||||
slug: Optional[str] = ""
|
||||
image: Optional[Any]
|
||||
recipeYield: Optional[str]
|
||||
|
||||
description: Optional[str]
|
||||
recipeCategory: Optional[List[str]] = []
|
||||
tags: Optional[List[str]] = []
|
||||
rating: Optional[int]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
@classmethod
|
||||
def getter_dict(_cls, name_orm: RecipeModel):
|
||||
return {
|
||||
**GetterDict(name_orm),
|
||||
"recipeCategory": [x.name for x in name_orm.recipeCategory],
|
||||
"tags": [x.name for x in name_orm.tags],
|
||||
}
|
||||
|
||||
|
||||
class Recipe(RecipeSummary):
|
||||
recipeYield: Optional[str]
|
||||
recipeIngredient: Optional[list[str]]
|
||||
recipeInstructions: Optional[list[RecipeStep]]
|
||||
nutrition: Optional[Nutrition]
|
||||
@@ -50,11 +68,8 @@ class Recipe(BaseModel):
|
||||
performTime: Optional[str] = None
|
||||
|
||||
# Mealie Specific
|
||||
slug: Optional[str] = ""
|
||||
tags: Optional[List[str]] = []
|
||||
dateAdded: Optional[datetime.date]
|
||||
notes: Optional[List[RecipeNote]] = []
|
||||
rating: Optional[int]
|
||||
orgURL: Optional[str]
|
||||
extras: Optional[dict] = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user