@view_config(renderer="templates/form.pt", name="selectize_with_tags")
@demonstrate("Selectize Widget (with tags)")
def selectize_with_tags(self):
choices = ()
class Schema(colander.Schema):
pepper = colander.SchemaNode(
colander.String(),
widget=deform.widget.SelectizeWidget(
values=choices,
tags=True,
selectize_options={
"createOnBlur": True,
"create": True,
},
attributes={
"placeholder": "Add a tag...",
},
),
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)