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:
Hayden
2021-04-27 11:17:00 -08:00
committed by GitHub
parent f748bbba68
commit 846d1eda5b
40 changed files with 1028 additions and 145 deletions

View File

@@ -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]]

View File

@@ -35,6 +35,7 @@ class Nutrition(BaseModel):
class RecipeSummary(BaseModel):
id: Optional[int]
name: str
slug: Optional[str] = ""
image: Optional[Any]