api.v1.serializers.email_serializers.EmailSerializer module¶
Module with the EmailSerializer serializer class.
- class api.v1.serializers.email_serializers.EmailSerializer.EmailSerializer(*args, **kwargs)[source]¶
Bases:
BaseEmailSerializerThe standard serializer for a
core.models.Email.Includes only the most relevant model fields. Includes nested serializers for the
core.models.Email.Email.replies,core.models.Email.Email.attachments`and :attr:`core.models.Email.Email.correspondentsforeign key and related fields.- replies: PrimaryKeyRelatedField¶
The replies mails are included by id only to prevent recursion.
- referenced_by: PrimaryKeyRelatedField¶
The referencing mails are included by id only to prevent recursion.
- attachments¶
The attachments are serialized by
eonvelope.AttachmentSerializers.BaseAttachmentSerializer.BaseAttachmentSerializer.
- _declared_fields = {'attachments': BaseAttachmentSerializer(many=True, 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) file_name = CharField(label='Filename', read_only=True) content_disposition = CharField(read_only=True) content_id = CharField(label='Content ID', read_only=True) content_maintype = CharField(read_only=True) content_subtype = CharField(read_only=True) datasize = IntegerField(read_only=True) email = PrimaryKeyRelatedField(read_only=True), 'correspondents': SerializerMethodField(read_only=True), 'referenced_by': ManyRelatedField(child_relation=PrimaryKeyRelatedField(read_only=True), read_only=True), 'replies': ManyRelatedField(child_relation=PrimaryKeyRelatedField(read_only=True), read_only=True)}¶
- correspondents¶
The emails are set from the
core.models.EmailCorrespondentviaget_correspondents().