Non-model serializer, which don't inherit their fields using the Meta.fields iterable, automatically take the fields as defined on the class. This means that all SerializerMethodFields are included, whether the user intends to expand them or not.
For non-model fields, we'll need to pass over the field definitions, and if not expanded, attempt to pop the field from the list.
Non-model serializer, which don't inherit their fields using the
Meta.fields
iterable, automatically take the fields as defined on the class. This means that allSerializerMethodField
s are included, whether the user intends to expand them or not.For non-model fields, we'll need to pass over the field definitions, and if not expanded, attempt to pop the field from the list.