12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #
- # Класс хранилище данных
- #
- class storage:
- __data = {}
- def __new__(cls):
- if not hasattr(cls, "instance"):
- cls.instance = super(storage, cls).__new__(cls)
- return cls.instance
- @property
- def data(self) -> dict:
- """
- Данные по моделям
- Returns:
- _type_: _description_
- """
- return self.__data
- @staticmethod
- def nomenclature_key():
- """
- Ключ для хранения номенклатуры
- Returns:
- _type_: _description_
- """
- return "nomenclature"
- @staticmethod
- def nomenclature_group_key():
- """
- Списк номенклатурных групп
- Returns:
- _type_: _description_
- """
- return "group"
- @staticmethod
- def measurement_unit_key():
- """
- Список единиц измерения
- Returns:
- _type_: _description_
- """
- return "unit"
- @staticmethod
- def ingredient_key():
- """
- Список ингредиентов
- Returns:
- _type_: _description_
- """
- return "ingredient"
- @staticmethod
- def recipe_key():
- """
- Список рецептов
- Returns:
- _type_: _description_
- """
- return "recipe"
- def transaction_key():
- """Список транзакций"""
- return "transaction"
|