Пример #1
0
 def _create(self, data):
     id = data.get("id")
     name = data.get("name")
     brewname = data.get("brewname")
     props = Props(data.get("props", {}))
     fermenter = Fermenter(id, name, brewname, props, 0)
     fermenter.steps = list(
         map(lambda item: self._create_step(fermenter, item),
             data.get("steps", [])))
     return fermenter
Пример #2
0
 def _update(old_item: Fermenter, item: Fermenter):
     old_item.name = item.name
     old_item.brewname = item.brewname
     old_item.props = item.props
     old_item.target_temp = item.target_temp
     return old_item