@view_config(renderer="templates/form.pt", name="radiochoice_inline")
@demonstrate("Radio Choice Widget (inline)")
def radiochoice_inline(self):
choices = (
("habanero", "Habanero"),
("jalapeno", "Jalapeno"),
("chipotle", "Chipotle"),
)
class Schema(colander.Schema):
pepper = colander.SchemaNode(
colander.String(),
validator=colander.OneOf([x[0] for x in choices]),
widget=deform.widget.RadioChoiceWidget(
values=choices, inline=True
),
title="Choose your pepper",
description="Select a Pepper",
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)