api.v1.serializers.emailcorrespondent_serializers.CorrespondentEmailSerializer module

Module with the CorrespondentEmailSerializer serializer class.

class api.v1.serializers.emailcorrespondent_serializers.CorrespondentEmailSerializer.CorrespondentEmailSerializer(*args, **kwargs)[source]

Bases: BaseEmailCorrespondentSerializer

The serializer for emails from core.models.EmailCorrespondent.

Used to serialize the emails belonging to a correspondent. Does not include this correspondent.

email

The email is serialized by api.v1.serializers.SimpleEmailSerializer.

class Meta[source]

Bases: Meta

Metadata class for the serializer.

fields: ClassVar[list[str]] = ['email', 'mention']

Includes only core.models.EmailCorrespondent.EmailCorrespondent.email and core.models.EmailCorrespondent.EmailCorrespondent.mention.

_declared_fields = {'email': BaseEmailSerializer(read_only=True):     id = BigIntegerField(label='ID', read_only=True)     is_favorite = BooleanField(label='Favorite status', required=False)     created = DateTimeField(label='Time of creation', read_only=True)     updated = DateTimeField(label='Time of last update', read_only=True)     message_id = CharField(label='Message-ID', read_only=True)     datetime = DateTimeField(label='Time received', read_only=True)     subject = CharField(read_only=True, style={'base_template': 'textarea.html'})     plain_bodytext = CharField(read_only=True, style={'base_template': 'textarea.html'})     html_bodytext = CharField(label='HTML bodytext', read_only=True, style={'base_template': 'textarea.html'})     datasize = IntegerField(read_only=True)     headers = JSONField(allow_null=True, decoder=None, encoder=None, read_only=True, style={'base_template': 'textarea.html'})     x_spam_flag = BooleanField(allow_null=True, label='X-Spam Flag', read_only=True)     mailbox = PrimaryKeyRelatedField(read_only=True)     in_reply_to = PrimaryKeyRelatedField(allow_empty=False, label='In reply to email', many=True, read_only=True)     references = PrimaryKeyRelatedField(allow_empty=False, label='Referencing emails', many=True, read_only=True)     correspondents = PrimaryKeyRelatedField(many=True, read_only=True)}