Serializers
Base
rn_forge.django.drf.serializers.base
Reusable DRF serializer bases for rn-forge-django.
BaseModelSerializer
Bases: ModelSerializer
Opinionated base serializer for models derived from BaseModel.
OmitEmptyMixin
Bases: Serializer
Drop optional fields whose value is empty from to_representation.
Empty means only None or "". Required fields are never stripped.
Fields
rn_forge.django.drf.serializers.fields
Reusable DRF serializer fields for rn-forge-django.
EnumChoiceField(*args, enum_type=None, **kwargs)
Bases: ChoiceField
Choice field that renders values as {code, name} mappings.
NestedReadPrimaryKeyRelatedField(*, serializer_class=None, read_fields=None, **kwargs)
Bases: PrimaryKeyRelatedField
Primary-key write field with optional nested read representation.
use_pk_only_optimization()
Disable DRF's PK-only shortcut when nested read serialization is enabled.
RawPassthroughField
Bases: JSONField
A JSON value whose keys stay verbatim under camelCase rendering and parsing.
The parser matches field names at any depth, so another field with the same name in the request body is also passed through.