Autocomplete Input Widget with Remote Data Source

Captured

None

Code (show in context)

    @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(
            size=60,
            min_length=1,
            values = '/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)