mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-10 04:15:38 -05:00
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:
@@ -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")
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class IngredientFood(CreateIngredientFood):
|
||||
class CreateIngredientUnit(UnitFoodBase):
|
||||
fraction: bool = True
|
||||
abbreviation: str = ""
|
||||
use_abbreviation: bool = False
|
||||
|
||||
|
||||
class SaveIngredientUnit(CreateIngredientUnit):
|
||||
|
||||
Reference in New Issue
Block a user