def criar_registro_ES(self, hour_in: str = None, hour_out: str = "") -> Dict[str, str]: try: self.data = pendulum.now().format(date_format) self.registros_ES = [] self.registros_ES = [ {"_id": str(uuid1()), "entrada": hour_in if hour_in else pendulum.now().format(hour_format), "saida": hour_out if hour_out else ""}] ret = Db.save('ponto', self) return ret if ret else None except: raise Exception
def save(self) -> Dict: try: return self.dict() if Db.save("colaborador", self) else {} except: # TODO EXCEPT raise Exception
def save(self) -> Dict[str, str]: try: ret = Db.save('ponto', self) return ret except: raise Exception