+ with Session(self.engine) as session:
+ cmd = select(Goal).where(Goal.complete_date == None)
+ return session.exec(cmd).all()
+
+
+ def get_goal(self, id):
+ with Session(self.engine) as session:
+ cmd = select(Goal).where(Goal.id == id)
+ goal = session.exec(cmd).first()
+ return (goal, goal.tasks)
+
+ def get_vision(self, id):
+ with Session(self.engine) as session:
+ cmd = select(Vision).where(Vision.id == id)
+ vision = session.exec(cmd).first()
+ if vision:
+ return (vision, vision.goals)
+ else:
+ return ('Not found', [])