Skip to content

FlexFieldsMixin

Overview

Mixin for DRF ViewSets to add 'permitted_expands' in serializer context based on the current action. It utilizes 'permit_{action}_expands' attributes of the ViewSet to determine expandable fields for each action (e.g., list, retrieve).

This replaces rest_flex_fields.FlexFieldsMixin and rest_flex_fields.FlexFieldsModelViewSet usage.

get_serializer_context

Signature

get_serializer_context(self)

Parameters

NameTypeRequiredDescription
selfyes

Source

server/vueda/core/viewsets/__init__.py:740

Source

server/vueda/core/viewsets/__init__.py:731

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2