Skip to content

Validation Framework #71

@FeodorFitsner

Description

@FeodorFitsner
  • Inspired by ASP.NET validation.
  • Works primarily with Textbox control.
  • Can recurively call validate() on any control.
  • .is_valid property stores the last validation result.
  • Textbox implements .validate() and .is_valid defined on Control level.
  • ...or user provides on_validate handler which returns a message if the value is invalid, for example:
first_name = Textbox(label="First name", on_validate=lambda v: "Please enter your first name" if v == "" else None)

or providing a Validator class:

first_name = Textbox(label="First name", validator=RequiredFieldValidator("Please enter your first name", focus_on_error=True))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions