def __init__(self, model):
    self.model = model
    self.close = sw.Icon(children=['mdi-close'], small=True)
    self.title = sw.CardTitle(class_='pa-0 ma-0', children=[sw.Spacer(), self.close])
    self.w_target = sw.Select(small=True, items=[{'text': f'{(i + 1)}0%', 'value': (i + 1)} for i in range(cp.nb_target)], v_model=model.target, label='target', dense=True)
    self.w_weight = sw.Select(small=True, items=[(i + 1) for i in range(cp.nb_weight)], v_model=model.weight, label='weight', dense=True)
    self.model.bind(self.w_target, 'target').bind(self.w_weight, 'weight')
    super().__init__(max_width='500px', class_='pa-1', children=[self.title, self.w_target, self.w_weight], viz=False, disabled=False)
    self.close.on_event('click', (lambda *args: self.hide()))
    dlink((self, 'disabled'), (self, 'loading'))
def __init__(self, model):
    self.model = model
    self.close = sw.Icon(children=['mdi-close'], small=True)
    self.title = sw.CardTitle(class_='pa-0 ma-0', children=[sw.Spacer(), self.close])
    self.w_target = sw.Select(small=True, items=[{'text': f'{(i + 1)}0%', 'value': (i + 1)} for i in range(cp.nb_target)], v_model=model.target, label='target', dense=True)
    self.w_weight = sw.Select(small=True, items=[(i + 1) for i in range(cp.nb_weight)], v_model=model.weight, label='weight', dense=True)
    self.model.bind(self.w_target, 'target').bind(self.w_weight, 'weight')
    super().__init__(max_width='500px', class_='pa-1', children=[self.title, self.w_target, self.w_weight], viz=False, disabled=False)
    self.close.on_event('click', (lambda *args: self.hide()))
    dlink((self, 'disabled'), (self, 'loading'))