mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-10 20:35:14 -05:00
Feature/shopping lists second try (#927)
* generate types * use generated types * ui updates * init button link for common styles * add links * setup label views * add delete confirmation * reset when not saved * link label to foods and auto set when adding to shopping list * generate types * use inheritence to manage exception handling * fix schema generation and add test for open_api generation * add header to api docs * move list consilidation to service * split list and list items controller * shopping list/list item tests - PARTIAL * enable recipe add/remove in shopping lists * generate types * linting * init global utility components * update types and add list item api * fix import cycle and database error * add container and border classes * new recipe list component * fix tests * breakout item editor * refactor item editor * update bulk actions * update input / color contrast * type generation * refactor controller dependencies * include food/unit editor * remove console.logs * fix and update type generation * fix incorrect type for column * fix postgres error * fix delete by variable * auto remove refs * fix typo
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
from typing import Optional, Union
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
from pydantic import Field
|
||||
|
||||
uuid4()
|
||||
from pydantic import UUID4, Field
|
||||
|
||||
|
||||
class CreateIngredientFood(CamelModel):
|
||||
class UnitFoodBase(CamelModel):
|
||||
name: str
|
||||
description: str = ""
|
||||
|
||||
|
||||
class CreateIngredientUnit(CreateIngredientFood):
|
||||
fraction: bool = True
|
||||
abbreviation: str = ""
|
||||
class CreateIngredientFood(UnitFoodBase):
|
||||
label_id: UUID4 = None
|
||||
label: MultiPurposeLabelSummary = None
|
||||
|
||||
|
||||
class IngredientFood(CreateIngredientFood):
|
||||
@@ -25,6 +25,11 @@ class IngredientFood(CreateIngredientFood):
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class CreateIngredientUnit(UnitFoodBase):
|
||||
fraction: bool = True
|
||||
abbreviation: str = ""
|
||||
|
||||
|
||||
class IngredientUnit(CreateIngredientUnit):
|
||||
id: int
|
||||
|
||||
@@ -77,3 +82,9 @@ class IngredientsRequest(CamelModel):
|
||||
class IngredientRequest(CamelModel):
|
||||
parser: RegisteredParser = RegisteredParser.nlp
|
||||
ingredient: str
|
||||
|
||||
|
||||
from mealie.schema.labels.multi_purpose_label import MultiPurposeLabelSummary
|
||||
|
||||
CreateIngredientFood.update_forward_refs()
|
||||
IngredientFood.update_forward_refs()
|
||||
|
||||
Reference in New Issue
Block a user