You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 19, 2022. It is now read-only.
To customize how an enum is serialized or deserialized, there are three options:
Setting by_value=True. This will cause both dumping and loading to use the value of the enum.
Setting load_by=EnumField.VALUE. This will cause loading to use the value of the enum.
Setting dump_by=EnumField.VALUE. This will cause dumping to use the value of the enum.
If either load_by or dump_by are unset, they will follow from by_value.
Additionally, there is EnumField.NAME to be explicit about the load and dump behavior, this
is the same as leaving both by_value and either load_by and/or dump_by unset.
Custom Error Message
A custom error message can be provided via the error keyword argument. It can accept three
format values:
{input}: The value provided to the schema field
{names}: The names of the individual enum members
{values}: The values of the individual enum members
Previously, the following inputs were also available but are deprecated and will be removed in 1.6: