@view_config(
renderer="templates/form.pt", name="autocomplete_remote_input"
)
@demonstrate("Autocomplete Input Widget (with Remote Data Source)")
def autocomplete_remote_input(self):
widget = deform.widget.AutocompleteInputWidget(
min_length=1,
values=self.request.route_path(
"deformdemo", traverse=("autocomplete_input_values",)
),
)
class Schema(colander.Schema):
text = colander.SchemaNode(
colander.String(),
validator=colander.Length(max=100),
widget=widget,
description='Enter some text (Hint: try "b" or "t")',
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)