def get(self, schedule): ans = self.database.executeKnowQuery("SELECT * FROM schedule WHERE employee = ?", (schedule.employee,)) if len(ans) == 0: return False ans = ans[0] ret = Schedule() ret.setAll(ans) return ret
def getAll(self): ans = self.database.executeKnowQuery("SELECT * FROM schedule") if len(ans) == 0: return False ret = [] for row in ans: temp = Schedule() temp.setAll(row) ret.append(temp) return ret