API Reference

The pages below are generated from source docstrings and cover the public module surface, including serializers, views, filter backends, and utilities.

For task-oriented documentation, see Usage, Serializer Options, and Advanced Topics.

Configuration Constants

The constants below document the runtime configuration values exposed by rest_flex_fields2.config.

Runtime configuration for REST_FLEX_FIELDS2.

Reads the optional REST_FLEX_FIELDS2 dict from Django settings and exposes validated constants used throughout the package. Raises AssertionError or ValueError on invalid configuration so errors surface at import time rather than at request time.

rest_flex_fields2.config.EXPAND_PARAM = 'expand'

Query parameter name used to request expandable fields.

rest_flex_fields2.config.FIELDS_PARAM = 'fields'

Query parameter name used to include only selected fields.

rest_flex_fields2.config.FLEX_FIELDS_OPTIONS = {}

Raw REST_FLEX_FIELDS2 dictionary from Django settings.

rest_flex_fields2.config.MAXIMUM_EXPANSION_DEPTH = None

Maximum nested expansion depth. None means unlimited.

rest_flex_fields2.config.OMIT_PARAM = 'omit'

Query parameter name used to omit selected fields.

rest_flex_fields2.config.RECURSIVE_EXPANSION_PERMITTED = True

Whether recursive field expansion is allowed.

rest_flex_fields2.config.WILDCARD_ALL = '~all'

Wildcard token that expands all fields.

rest_flex_fields2.config.WILDCARD_ASTERISK = '*'

Wildcard token alternative that expands all fields.

rest_flex_fields2.config.WILDCARD_VALUES = ['~all', '*']

Allowed wildcard tokens for expansion, configurable via Django settings.