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
When an object with a SerializerMethodField its accessed directly, its value gets added to the serialized output. However when an object is nested, its SerializerMethodField doesn't get called. (Supporting test in #3901)
Is this the intended behavior?
For example, a ProductGroup serializer has a SerializerMethodField that returns product logos. When accessed directly, those logos are populated:
When an object with a
SerializerMethodField
its accessed directly, its value gets added to the serialized output. However when an object is nested, itsSerializerMethodField
doesn't get called. (Supporting test in #3901)Is this the intended behavior?
For example, a
ProductGroup
serializer has aSerializerMethodField
that returns product logos. When accessed directly, those logos are populated:When its nested in the response of a Dashboard serializer, its left out:
Using DRF
3.3.2
, here's a setup to reproduce:Serializers.py:
models.py:
The text was updated successfully, but these errors were encountered: