pythonjinja2pyramiddeformcolander

colander schema data type define for password input filed?


I create login form(email and password field) schema using deform and colander . but password filed show my password character. how to hide as normal HTML password input filed.

email =  colander.SchemaNode(
    colander.Str(),
    title='Email',
    validator=colander.All(colander.Email()),
    widget=deform.widget.TextInputWidget(size=40, maxlength=260, type='email',  placeholder="youremail@example.com"),
    description="The email address under which you have your account.")
password = colander.SchemaNode(colander.String())

Solution

  • You only created a schema node without a PasswordWidget. See the deform demo example:

    password = colander.SchemaNode(
        colander.String(),
        validator=colander.Length(min=5, max=100),
        widget=deform.widget.PasswordWidget(),
        description='Enter a password')