123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #
- # Класс хранилище данных
- #
- 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"
-
|