def pretty_print(goal, tasks):
results = []
results.append(f' ## {goal}')
+ if not tasks:
+ results.append('-- Nothing to list --')
+
for task in tasks:
if(task.complete_date):
results.append(f' - [x] {task}')
else:
results.append(f' - [ ] {task}')
- else:
- results.append('-- Nothing to list --')
return results
return session.exec(cmd).all()
+ def get_done_goals(self):
+ '''List all goals'''
+ 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()
goal.vision_id = vision_id
session.commit()
- return 'Success'
def add_note(self, note, goal):
'''Notes print with the goal.'''