mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-07 16:33:10 -05:00
feature/category-tag-crud (#354)
* update tag route * search.and * offset for mobile * relative imports * get settings * new page * category/tag CRUD * bulk assign frontend * Bulk assign * debounce search * remove dev data * recipe store refactor * fix mobile view * fix failing tests * commit test data Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -2,6 +2,7 @@ from typing import List, Optional
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
from mealie.schema.recipe import Recipe
|
||||
from pydantic.utils import GetterDict
|
||||
|
||||
|
||||
class CategoryIn(CamelModel):
|
||||
@@ -15,6 +16,13 @@ class CategoryBase(CategoryIn):
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
@classmethod
|
||||
def getter_dict(_cls, name_orm):
|
||||
return {
|
||||
**GetterDict(name_orm),
|
||||
"total_recipes": len(name_orm.recipes),
|
||||
}
|
||||
|
||||
|
||||
class RecipeCategoryResponse(CategoryBase):
|
||||
recipes: Optional[List[Recipe]]
|
||||
|
||||
@@ -35,6 +35,7 @@ class Nutrition(BaseModel):
|
||||
|
||||
|
||||
class RecipeSummary(BaseModel):
|
||||
id: Optional[int]
|
||||
name: str
|
||||
slug: Optional[str] = ""
|
||||
image: Optional[Any]
|
||||
|
||||
Reference in New Issue
Block a user