mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 04:55:21 +02:00
* merge category and tag selector * unifiy category selector * add hint * spacing * fix nextcloud migration * simplify email validator #261 * formatting * cleanup * auto-gen * format * update run script * unified category/tag selector * rename component * Add advanced search link * remove old code * convert keywords to tags * add proper behavior on rename * proper image name association on rename * fix test cleanup * changelog * set docker comppand * minify on migration Co-authored-by: hay-kot <hay-kot@pm.me>
35 lines
583 B
Python
35 lines
583 B
Python
from typing import List, Optional
|
|
|
|
from fastapi_camelcase import CamelModel
|
|
from mealie.schema.recipe import Recipe
|
|
|
|
|
|
class CategoryIn(CamelModel):
|
|
name: str
|
|
|
|
|
|
class CategoryBase(CategoryIn):
|
|
id: int
|
|
slug: str
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class RecipeCategoryResponse(CategoryBase):
|
|
recipes: Optional[List[Recipe]]
|
|
|
|
class Config:
|
|
schema_extra = {"example": {"id": 1, "name": "dinner", "recipes": [{}]}}
|
|
|
|
|
|
class TagIn(CategoryIn):
|
|
pass
|
|
|
|
|
|
class TagBase(CategoryBase):
|
|
pass
|
|
|
|
|
|
class RecipeTagResponse(RecipeCategoryResponse):
|
|
pass
|