Best way to build custom functional validator / serializer classes? #9452
Unanswered
ZackPlauche
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take this function:
If I apply this to a model, like so:
When it gets serialized it would ignore
A
'sbuzz
field from the json dump fromB
.To me, the functional approach is kind of ugly as a function, like
nested_exclude_serializer
, and I'd prefer to look something like the PlainSerializer class when used, with the proper linting and what not, like:What's the best way to go about doing this? Or is what I was doing the first time viable?
Beta Was this translation helpful? Give feedback.
All reactions