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