Open Lefort-Antoine opened 1 year ago
Found a way.
mydb.myrecodtable._dev_schema._declared_fields["adress"].error_messages["message"]
Hi, if you want to customize error messages, you can override it as such:
insee = fields.String(
required=True,
error_messages={
"required": "Insee is a required field."
}
I'd recommend this way if it is only a specific field used once, if you want to customize a field you could create your own field instance
Hi,
I try to customize my error message with a range validation via validate
left_cantilever = fields.Float(required=False,
load_default=None,
allow_none=True,
validate=validate.Range(min=0.5, min_strict=False, error="left_cantilever_error"),
)
Unfortunaltely, I do not get back my custom message. I get back : "given value (0.3) does not respect range conditions." Do you know how i could customize my message when doing a range validation ?
Hy,
How can we adress error message ? This synthaxe is not working :
adress = fields.String(required=True, error_messages=dict( message="Adress is required", code=100 ) )
Regards