@view_config(renderer="templates/form.pt", name="checkboxchoice_inline")
@demonstrate("Checkbox Choice Widget (inline)")
def checkboxchoice_inline(self):
choices = (
("habanero", "Habanero"),
("jalapeno", "Jalapeno"),
("chipotle", "Chipotle"),
)
class Schema(colander.Schema):
pepper = colander.SchemaNode(
colander.Set(),
widget=deform.widget.CheckboxChoiceWidget(
values=choices, inline=True
),
validator=colander.Length(min=1),
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)