@view_config(
renderer="templates/form.pt", name="checkedpassword_redisplay"
)
@demonstrate("Checked Password Widget (redisplay on validation failure)")
def checkedpassword_redisplay(self):
class Schema(colander.Schema):
password = colander.SchemaNode(
colander.String(),
validator=colander.Length(min=5),
widget=deform.widget.CheckedPasswordWidget(redisplay=True),
description="Type your password and confirm it",
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)