mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-05 23:43:11 -05:00
feat(backend): ✨ add rename tag, tool, category support (#875)
This commit is contained in:
@@ -3,4 +3,5 @@ from .recipe_category import *
|
||||
from .recipe_comments import *
|
||||
from .recipe_image_types import *
|
||||
from .recipe_ingredient import *
|
||||
from .recipe_tool import *
|
||||
from .request_helpers import *
|
||||
|
||||
@@ -18,7 +18,6 @@ from .recipe_notes import RecipeNote
|
||||
from .recipe_nutrition import Nutrition
|
||||
from .recipe_settings import RecipeSettings
|
||||
from .recipe_step import RecipeStep
|
||||
from .recipe_tool import RecipeTool
|
||||
|
||||
app_dirs = get_app_dirs()
|
||||
|
||||
@@ -35,6 +34,11 @@ class RecipeCategory(RecipeTag):
|
||||
pass
|
||||
|
||||
|
||||
class RecipeTool(RecipeTag):
|
||||
id: int = 0
|
||||
on_hand: bool = False
|
||||
|
||||
|
||||
class CreateRecipeByUrl(BaseModel):
|
||||
url: str
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class RecipeTagResponse(RecipeCategoryResponse):
|
||||
pass
|
||||
|
||||
|
||||
from .recipe import Recipe
|
||||
from . import Recipe
|
||||
|
||||
RecipeCategoryResponse.update_forward_refs()
|
||||
RecipeTagResponse.update_forward_refs()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import List
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
|
||||
|
||||
@@ -8,6 +10,19 @@ class RecipeToolCreate(CamelModel):
|
||||
|
||||
class RecipeTool(RecipeToolCreate):
|
||||
id: int
|
||||
slug: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class RecipeToolResponse(RecipeTool):
|
||||
recipes: List["Recipe"] = []
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
from .recipe import Recipe
|
||||
|
||||
RecipeToolResponse.update_forward_refs()
|
||||
|
||||
Reference in New Issue
Block a user