@view_config(renderer="templates/form.pt", name="textinput_with_css_class")
@demonstrate("Text Input Widget (with CSS class)")
def textinput_with_css_class(self):
css_widget = deform.widget.TextInputWidget(
css_class="deform-widget-with-style"
)
class Schema(colander.Schema):
text = colander.SchemaNode(
colander.String(),
validator=colander.Length(max=100),
widget=css_widget,
description="Enter some text",
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)