validation.result

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Validation result — immutable container for validated data or errors.

Validation result — immutable container for validated data or errors.

validation.result

Name Type Default Description
type —
qualified_name —
element_type —
description —
source_file —
line_number —
is_autodoc —
autodoc_element —
_autodoc_template —
_autodoc_url_path —
_autodoc_page_type —
title —
doc_content_hash —

Symbols on this page

ValidationResult
class

The outcome of validating form data against a set of rules.

is_validis True when there are no errors. The result is falsy when invalid, so you can write::

result = validate(form, rules)
if not result:
    return Template("form.html", form=form, errors=result.errors)

datacontains the cleaned string values for all validated fields (only populated when there are no errors).

errorsmaps field names to lists of error messages::

{"title": ["This field is required"],
 "email": ["Must be a valid email address"]}

View source · /home/runner/work/chirp/chirp/site/../src/chirp/validation/result.py:1