33 lines
693 B
Python
33 lines
693 B
Python
from object_pool import ObjectPool
|
|
|
|
class Response:
|
|
def init(self, rID, optionID, pupilID, delay):
|
|
self.id = rID
|
|
self.optionID = optionID
|
|
self.pupilID = pupilID
|
|
self.delay = delay
|
|
|
|
return self
|
|
|
|
def init_from_data(self, data):
|
|
return self.init(*data)
|
|
|
|
def get_id(self):
|
|
return self.id
|
|
|
|
def get_option_id(self):
|
|
return self.optionID
|
|
|
|
def get_pupil_id(self):
|
|
return self.pupilID
|
|
|
|
def get_delay(self):
|
|
return delay
|
|
|
|
class ResponsePool:
|
|
def __init__(self, db = None):
|
|
self.object_pool = ObjectPool("response", Response)
|
|
|
|
if db:
|
|
self.object_pool.load_from_db(db)
|