Closed Lucasmiguelmac closed 2 years ago
Already figured. This can be achieved by doing the following:
class MySchema(ModelSchema):
...
@validator("my_field", check_fields=False)
def format_my_field(cls, v):
return some_changed_value
Hello there!
Is there yet a way to use something like DRF's string-related field? That is, for a model field with a relation, set it to a custom field that returns the related model's string representation.