evenicoulddoit / django-rest-framework-serializer-extensions

Extensions to help DRY up Django Rest Framework serializers
Other
247 stars 23 forks source link

Non-model serializers always include method fields #8

Closed evenicoulddoit closed 7 years ago

evenicoulddoit commented 7 years ago

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.