def fieldset(self, html, bfield, container): control = Html('div', cn='control-group') if html.attr('type') == 'checkbox': control.append(Html('label', html, bfield.label, cn='checkbox')) else: label = Html('label', bfield.label, cn='control-label') label.attr('for', bfield.id) control.append(label) control.append(Html('div', html, cn='controls')) yield control
def html(self, bfield, **params): html = Html('select') if self.multiple: html.attr('multiple', 'multiple') self.choices.add_options(bfield, html) return html