test-platform/server/cgi/db/response.py

33 lines
693 B
Python
Raw Normal View History

2024-05-25 19:18:26 +03:00
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)