]> apps.delaporte.us Git - matrix-goal-bot.git/blobdiff - goals/db.py
Add ability to list complete goals
[matrix-goal-bot.git] / goals / db.py
index 6e539481dbe0184cd29906c56c65be43c3df0884..11b546773665e758eadcc77f478001892afb9e8b 100644 (file)
@@ -92,6 +92,13 @@ class Data():
             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)