@presentation.render_for(CardWeightEditor, 'edit')
def render_CardWeightEditor_edit(self, h, comp, *args):
    if self.weighting_switch == self.WEIGHTING_FREE:
        id_ = h.generate_id('weight')
        with h.form:
            h << h.input(
                value=self.weight(),
                type='text',
                id_=id_).action(self.weight).error(self.weight.error)
            h << h.button(_('Save'), class_='btn btn-primary').action(answer, self, comp)
            h << h.script(ajax.py2js(id_) % """document.getElementById(%s).focus(); """)
    elif self.weighting_switch == self.WEIGHTING_LIST:
        with h.form:
            with h.div(class_='btn select'):
                with h.select.action(self.weight):
                    for value in self.allowed_weights.split(','):
                        h << h.option(value, value=value).selected(self.weight)
            h << h.button(_('Save'), class_='btn btn-primary').action(answer, self, comp)

    return h.root
dataset/ETHPy150Open Net-ng/kansha/kansha/card_addons/weight/view.py/render_CardWeightEditor_edit/swapped operands of `%`