@view_config(
renderer="templates/form.pt", name="sequence_of_autocompletes"
)
@demonstrate("Sequence of Autocomplete Widgets")
def sequence_of_autocompletes(self):
choices = ["bar", "baz", "two", "three"]
widget = deform.widget.AutocompleteInputWidget(values=choices)
class Sequence(colander.SequenceSchema):
text = colander.SchemaNode(
colander.String(),
validator=colander.Length(max=100),
widget=widget,
description='Enter some text (Hint: try "b" or "t")',
)
class Schema(colander.Schema):
texts = Sequence()
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)