return results
+def _get_with_id(cls, item_id):
+ return select(cls).where(cls.id == item_id)
+
+def _get_with_name(cls, name):
+ return select(cls).where(func.lower(cls.name) == func.lower(name))
+
+
class Data():
def __init__(self, db_file=None):
if not db_file:
return pref.goal_id
- def clear_list(self, goal_id, clear_all=False):
+ def clear(self, goal_id, clear_all=False):
with Session(self.engine) as session:
goal = session.exec(_get_with_id(Goal, goal_id)).first()
for item in goal.tasks: