我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用wtforms.fields.PasswordField()。
def scaffold_form(self): form_class = super(UserAdmin, self).scaffold_form() form_class.password2 = PasswordField('New Password') return form_class
def conv_String(self, model, field, kwargs): if field.regex: kwargs['validators'].append(validators.Regexp(regex=field.regex)) self._string_common(model, field, kwargs) password_field = kwargs.pop('password', False) textarea_field = kwargs.pop('textarea', False) or not field.max_length if password_field: return f.PasswordField(**kwargs) if textarea_field: return f.TextAreaField(**kwargs) return f.StringField(**kwargs)
def convert_crypto_aes(self, field, field_args): return wtforms_fields.PasswordField(**field_args)