Suggestion about the behavior of the get_value method in the Serializer class. #9621
Unanswered
hanlsin
asked this question in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
source
inField
class is described as 'The name of the attribute that will be used to populate the field.' However, couldn't it be generalized for broader use?Currently,
get_value
inSerializer
andField
class retrieves the value from the dictionary using onlyfield_name
as the key, but ifsource
is specified and differs fromfield_name
, it seems like usingsource
as the key to find the value would be a good approach.For example,
Overriding the
get_value
method, of course, could be straightforward to support this functionality.However, I wonder if supporting this as the default behavior might be a more user-friendly approach.
Are there any potential issues with using it this way?
Beta Was this translation helpful? Give feedback.
All reactions