None
@view_config(renderer="templates/form.pt", name="select2_with_multiple")
@demonstrate("Select2 Widget (with multiple)")
def select2_with_multiple(self):
choices = (
("habanero", "Habanero"),
("jalapeno", "Jalapeno"),
("chipotle", "Chipotle"),
)
class Schema(colander.Schema):
pepper = colander.SchemaNode(
colander.Set(),
widget=deform.widget.Select2Widget(
values=choices, multiple=True
),
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)