[Python] Custom validators in WTForms using Flask

Discussão em 'Python' iniciado por Stack, Março 4, 2025.

  1. Stack

    Stack Membro Participativo

    I need to make a custom validator in WTForms where the input is to be: number:number - e.g. 2:1

    match1 = StringField('Russia-Saudi Arabia', validators=[DataRequired()])


    So, my question is - how to create such validator?

    I've looked upon the documentation at http://wtforms.readthedocs.io/en/latest/validators.html, but was not very helpful (for me) in this case.

    Thanks in advance

    Continue reading...

Compartilhe esta Página