drf-flex-fields - Dynamically set fields and expand nested resources in Django REST Framework serializers
Flexible, dynamic fields and nested models for Django REST Framework serializers. Works with both Python 2 and 3. FlexFields (DRF-FF) for Django REST Framework is a package designed to provide a common baseline of functionality for dynamically setting fields and nested models within DRF serializers. To remove unneeded fields, you can dynamically set fields, including nested fields, via URL parameters (?fields=name,address.zip) or when configuring serializers. Additionally, you can dynamically expand fields from simple values to complex nested models, or treat fields as "deferred", and expand them on an as-needed basis.