diff options
Diffstat (limited to 'data_model/SubTask.gd')
-rw-r--r-- | data_model/SubTask.gd | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/data_model/SubTask.gd b/data_model/SubTask.gd new file mode 100644 index 0000000..fa044a5 --- /dev/null +++ b/data_model/SubTask.gd @@ -0,0 +1,24 @@ +class_name SubTask
+
+class SubTask_data:
+ var id
+ var task_id
+ var name
+ var date_completed
+
+ func _init(record):
+ self.id = record['id']
+ self.task_id = record['task_id']
+ self.name = record['name']
+ self.date_completed = record['date_completed']
+
+static func get_by_task(task_id):
+ var records = DBMS.query("""
+ SELECT * FROM "SubTasks"
+ WHERE task_id = ?
+ """,
+ [task_id])
+ var subtasks = []
+ for record in records:
+ subtasks.push_back(SubTask_data.new(record))
+ return subtasks
|