from db.object_pool import ObjectPool class Test: def init(self, sID, name): self.id = sID self.name = name return self def init_from_data(self, data): return self.init(*data) def get_id(self): return self.id def get_name(self): return self.name def render_short(self): return f'
#{self.id}{self.name}
РедагуватиВидалити
' class TestPool: def __init__(self, db): self.object_pool = ObjectPool("test", Test) if db: self.object_pool.load_from_db(db)