feat: add unit abbreviation support (#1332)

* add 'use-abbreviation' db column

* type generation

* add view and edit elements

* check for use_abbreviation to display

* fix: alembic version check

* test: add use_abbreviation prop tests
This commit is contained in:
Hayden
2022-06-01 11:59:50 -08:00
committed by GitHub
parent 592b1de39d
commit 52fbf6b833
13 changed files with 77 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ class IngredientUnitModel(SqlAlchemyBase, BaseMixins):
name = Column(String)
description = Column(String)
abbreviation = Column(String)
use_abbreviation = Column(Boolean, default=False)
fraction = Column(Boolean, default=True)
ingredients = orm.relationship("RecipeIngredient", back_populates="unit")

View File

@@ -34,6 +34,7 @@ class IngredientFood(CreateIngredientFood):
class CreateIngredientUnit(UnitFoodBase):
fraction: bool = True
abbreviation: str = ""
use_abbreviation: bool = False
class SaveIngredientUnit(CreateIngredientUnit):