[docs]classConditionalResumedSerializerMixin(object):""" Overrides get_serializer_class to use a resumed Serializer in list. Set ``resumed_serializer_class`` attribute on your viewset to enable this behavior else the default serializer from ``serializer_class`` is always used. This won't work with classes which does not set attribute ``action`` like ``APIView``. The goal of this behavior is to have lighter payload on lists which does not need to return everything from an object. """defget_serializer_class(self):ifself.action=="list":returnself.resumed_serializer_classreturnsuper().get_serializer_class()