From d406db13f0e14766e61c0b12e95938cf6ceb16d8 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Sat, 27 Aug 2022 00:55:29 -0400 Subject: Fix line endings and tabs again --- data_model/TimeSlot.gd | 78 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'data_model/TimeSlot.gd') diff --git a/data_model/TimeSlot.gd b/data_model/TimeSlot.gd index 80b7671..ac1a008 100644 --- a/data_model/TimeSlot.gd +++ b/data_model/TimeSlot.gd @@ -1,39 +1,39 @@ -class_name TimeSlot - -class TimeSlot_data: - var id - var schedule_id - var start_time - var end_time - var name - var date_completed - - func _init(record): - self.id = record['id'] - self.schedule_id = record['schedule_id'] - self.start_time = record['start_time'] - self.end_time = record['end_time'] - self.name = record['name'] - self.date_completed = record['date_completed'] - -static func get_by_id(id): - var record = DBMS.query(""" - SELECT * FROM "TimeSlots" - WHERE id = ? - """, - [id]) - record = record[0] - return TimeSlot_data.new(record) - -static func get_by_schedule_name(schedule_name): - var records = DBMS.query(""" - SELECT "TimeSlots".* FROM "TimeSlots" - JOIN "Schedules" ON "TimeSlots".schedule_id = "Schedules".id - WHERE "Schedules".name = ? - ORDER BY "TimeSlots".start_time - """, - [schedule_name]) - var timeslots = [] - for record in records: - timeslots.push_back(TimeSlot_data.new(record)) - return timeslots +class_name TimeSlot + +class TimeSlot_data: + var id + var schedule_id + var start_time + var end_time + var name + var date_completed + + func _init(record): + self.id = record['id'] + self.schedule_id = record['schedule_id'] + self.start_time = record['start_time'] + self.end_time = record['end_time'] + self.name = record['name'] + self.date_completed = record['date_completed'] + +static func get_by_id(id): + var record = DBMS.query(""" + SELECT * FROM "TimeSlots" + WHERE id = ? + """, + [id]) + record = record[0] + return TimeSlot_data.new(record) + +static func get_by_schedule_name(schedule_name): + var records = DBMS.query(""" + SELECT "TimeSlots".* FROM "TimeSlots" + JOIN "Schedules" ON "TimeSlots".schedule_id = "Schedules".id + WHERE "Schedules".name = ? + ORDER BY "TimeSlots".start_time + """, + [schedule_name]) + var timeslots = [] + for record in records: + timeslots.push_back(TimeSlot_data.new(record)) + return timeslots -- cgit v1.2.3