Form with validation

    0

    2

    Python public recipes

    Flask form with validation

    # custom validator
    class FormName(FlaskForm):
      answer = IntegerField('The Number')
      submit = SubmitField()
      def validate_answer(form, field):
        if field.data != 42:
          raise ValidationError('Must be 42.')
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.