from object_pool import ObjectPool class Question: def init(self, sID, title, max_time, test_id): self.id = sID self.title = title self.max_time = max_time self.test_id = test_id return self def init_from_data(self, data): return self.init(*data) def get_id(self): return self.id def get_title(self): return self.title def get_max_time(self): return self.max_time def get_test_id(self): return self.test_id ''' class QuestionPool: def __init__(self): self.pool = [] def load_from_db(self, cur): db.execute("SELECT * FROM response_option;") self.pool = [ResponseOption().init_from_data(i) for i in cur] return self ''' class QuestionPool: def __init__(self): self.object_pool = ObjectPool("question", Question) if db: self.object_pool.load_from_db(db)