def getByID(self, id): ans = self.database.executeKnowQuery( 'SELECT * FROM request WHERE id = ?', (id, )) if (len(ans) == 0): return False ans = ans[0] ret = Request() ret.setAll(ans) return ret
def getAll(self): ans = self.database.executeKnowQuery('SELECT * from request') if (len(ans) == 0): return False ret = [] for r in ans: temp = Request() temp.setAll(r) ret.append(temp) return ret
def getByStatus(self, status): ans = self.database.executeKnowQuery( 'SELECT * FROM request WHERE status = ?', (status, )) if (len(ans) == 0): return [] ret = [] for r in ans: temp = Request() temp.setAll(r) ret.append(temp) return ret
def get(self, request): ans = self.database.executeKnowQuery( 'SELECT * FROM request WHERE clientID = ?', (request.getClientID(), )) if (len(ans) == 0): return False ret = [] for row in ans: req = Request() req.setAll(row) ret.append(req) return ret
def new_request_submit(self, subview): data = subview.get_all() new = Request() new.setClientID(data[0]) new.setEventType(data[1]) new.setStartDate(data[2]) new.setEndDate(data[3]) new.setExpectedParticipants(data[4]) new.setPreferences(data[5]) new.setExpectedBudget(data[6]) new.comment = data[7] self.model.request_db.add(new) self.clear_frame(subview)
def getByClientID(self, clientid): temp = Request() temp.clientid = clientid return self.get(temp)