Validation
This is the official documentation of the forestadmin-agent-django and forestadmin-agent-flask Python agents.

Columns of type
VARCHAR(15)will automatically carry aless than 15 charsvalidator.Non-nullable columns will automatically carry a
Presentvalidator.
However, you may want to enforce stricter restrictions than the ones which are implemented in your data source.
Adding validation rules
The list of operators (Present, LongerThan, ...) which can be used when adding validators is the same as the filter operators.
collection.add_field_validation(
"firstName", "present"
).add_field_validation(
"firstName", "longer_than", 2
).add_field_validation(
"firstName", "shorter_than", 30
).add_field_validation(
"firstName", "match", r"^[a-z]+$"
)Last updated
Was this helpful?