api.v1.serializers.attachment_serializers.BaseAttachmentSerializer module

Module with the BaseAttachmentSerializer serializer class.

class api.v1.serializers.attachment_serializers.BaseAttachmentSerializer.BaseAttachmentSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The base serializer for core.models.Attachment.

Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for core.models.Attachment should inherit from this.

class Meta[source]

Bases: object

Metadata class for the base serializer.

Contains constraints that must be implemented by all serializers. Other serializer metaclasses should inherit from this. read_only_fields and exclude must not be shortened in subclasses.

model

The model to serialize.

alias of Attachment

exclude: ClassVar[list[str]] = ['file_path']

Exclude the core.models.Attachment.Attachment.file_path field.

read_only_fields: Final[list[str]] = ['file_name', 'content_disposition', 'content_id', 'content_maintype', 'content_subtype', 'datasize', 'email', 'created', 'updated']

The core.models.Attachment.Attachment.is_healthy, core.models.Attachment.Attachment.datasize, core.models.Attachment.Attachment.email, core.models.Attachment.Attachment.created and core.models.Attachment.Attachment.updated fields are read-only.

_declared_fields = {}