api.v1.serializers package

api.v1.serializers package containing serializers for the Eonvelope API version 1.

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

Bases: BaseAccountSerializer

The standard serializer for a core.models.Account.

Includes a nested serializer for the related field mailboxes.

_declared_fields = {'mailboxes': BaseMailboxSerializer(many=True, read_only=True):     id = BigIntegerField(label='ID', read_only=True)     is_favorite = BooleanField(label='Favorite status', required=False)     is_healthy = BooleanField(allow_null=True, label='Health status', read_only=True)     last_error = CharField(read_only=True, style={'base_template': 'textarea.html'})     last_error_occurred_at = DateTimeField(allow_null=True, label='Time of last error occurrence', read_only=True)     created = DateTimeField(label='Time of creation', read_only=True)     updated = DateTimeField(label='Time of last update', read_only=True)     name = CharField(read_only=True)     type = ChoiceField(choices=[('INBOX', 'Inbox'), ('OUTBOX', 'Outbox'), ('SENT', 'Sent'), ('JUNK', 'Junk'), ('DRAFTS', 'Drafts'), ('TRASH', 'Trash'), ('', '')], read_only=True)     save_attachments = BooleanField(help_text='Whether the attachments from the emails in this mailbox will be saved.', required=False)     save_to_eml = BooleanField(help_text='Whether the emails in this mailbox will be stored in .eml files.', label='Save as .eml', required=False)     account = PrimaryKeyRelatedField(read_only=True), 'user': HiddenField(default=CurrentUserDefault())}
mailboxes

The mailboxes of the account are serialized by core.models.MailboxSerializers.BaseMailboxSerializer.BaseMailboxSerializer.

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

Bases: ModelSerializer

The base serializer for core.models.Account.

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

user

The core.models.Account.Account.user field is included but hidden.

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

alias of Account

fields = '__all__'

Include all fields.

read_only_fields: Final[list[str]] = ['is_healthy', 'last_error', 'last_error_occurred_at', 'created', 'updated']

The core.models.Account.Account.is_healthy, core.models.Account.Account.created and core.models.Account.Account.updated fields are read-only.

extra_kwargs = {'password': {'write_only': True}}

The core.models.Account.Account.password field is set to write-only for security reasons.

_declared_fields = {'user': HiddenField(default=CurrentUserDefault())}
validate(attrs)[source]

Include full model-side validation to allow testing of account on submission.

Parameters:

attrs (dict[str, Any]) – The attributes on the serializer.

Return type:

dict[str, Any]

Returns:

The same attributes.

Raises:

serializers.ValidationError – If the validation fails.

class api.v1.serializers.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

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 = {}
class api.v1.serializers.BaseCorrespondentSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The base serializer for core.models.Correspondent.

Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for core.models.Correspondent 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 must not be shortened in subclasses.

model

alias of Correspondent

exclude: Final[list[str]] = ['user']

Exclude only the core.models.Correspondent.Correspondent.user field.

read_only_fields: Final[list[str]] = ['email_address', 'email_name', 'list_id', 'list_owner', 'list_subscribe', 'list_unsubscribe', 'list_unsubscribe_post', 'list_post', 'list_help', 'list_archive', 'created', 'updated']

The core.models.Correspondent.Correspondent.email_address, core.models.Correspondent.Correspondent.created and core.models.Correspondent.Correspondent.updated fields are read-only.

_declared_fields = {}
class api.v1.serializers.BaseDaemonSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The base serializer for core.models.Daemon.

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

interval

The interval is serialized by api.v1.serializers.django_celery_beat_serializers.IntervalScheduleSerializer. It can be altered.

celery_task

The celery_task is serialized by api.v1.serializers.django_celery_beat_serializers.PeriodicTaskSerializer.

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

alias of Daemon

fields: ClassVar[str] = '__all__'

Include all fields.

read_only_fields: Final[list[str]] = ['uuid', 'is_healthy', 'last_error', 'last_error_occurred_at', 'created', 'updated']

The core.models.Daemon.Daemon.uuid, core.models.Daemon.Daemon.is_healthy, core.models.Daemon.Daemon.created and core.models.Daemon.Daemon.updated fields are read-only.

_declared_fields = {'celery_task': PeriodicTaskSerializer(read_only=True):     enabled = BooleanField(help_text='Set to False to disable the schedule', read_only=True)     last_run_at = DateTimeField(allow_null=True, help_text='Datetime that the schedule last triggered the task to run. Reset to None if enabled is set to False.', label='Last Run Datetime', read_only=True)     total_run_count = IntegerField(help_text='Running count of how many times the schedule has triggered the task', label='Total Run Count', read_only=True), 'interval': IntervalScheduleSerializer():     id = IntegerField(label='ID', read_only=True)     every = IntegerField(help_text='Number of interval periods to wait before running the task again', label='Number of Periods', max_value=2147483647, min_value=1)     period = ChoiceField(choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes'), ('seconds', 'Seconds'), ('microseconds', 'Microseconds')], help_text='The type of period between task runs (Example: days)', label='Interval Period')}
validate(attrs)[source]

Include full model-side validation to allow testing of account on submission.

Parameters:

attrs (dict[str, Any]) – The attributes on the serializer.

Return type:

dict[str, Any]

Returns:

The same attributes.

Raises:

serializers.ValidationError – If the validation fails.

validate_mailbox(value)[source]

Validate that the given mailbox belongs to the requesting user.

Return type:

Mailbox

Parameters:

value (Mailbox)

update(instance, validated_data)[source]

Extended to add the intervaldata to the instance.

Important

The nested intervaldata must be popped as update does not support nested dicts! There should not be duplicate IntervalSchedules. https://django-celery-beat.readthedocs.io/en/latest/index.html#example-creating-interval-based-periodic-task

Return type:

Daemon

Parameters:
create(validated_data)[source]

Extended to add the intervaldata to the instance.

Important

The nested intervaldata must be popped as create does not support nested dicts! There should not be duplicate IntervalSchedules. https://django-celery-beat.readthedocs.io/en/latest/index.html#example-creating-interval-based-periodic-task

Return type:

Daemon

Parameters:

validated_data (dict)

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

Bases: ModelSerializer

The base serializer for core.models.EmailCorrespondent.

Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for core.models.EmailCorrespondent 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 must not be shortened in subclasses.

model

alias of EmailCorrespondent

fields: ClassVar[list[str] | str] = '__all__'
read_only_fields: Final[list[str]] = ['email', 'correspondent', 'mention', 'created', 'updated']

All fields are read-only.

_declared_fields = {}
class api.v1.serializers.BaseEmailSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The base serializer for core.models.Email.

Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for core.models.Email 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

alias of Email

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

Exclude the core.models.Email.Email.file_path field.

read_only_fields: Final[list[str]] = ['message_id', 'datetime', 'subject', 'plain_bodytext', 'html_bodytext', 'in_reply_to', 'references', 'datasize', 'correspondents', 'mailbox', 'headers', 'x_spam_flag', 'created', 'updated']

All fields except for core.models.Email.Email.is_favorite are read-only.

_declared_fields = {}
class api.v1.serializers.BaseMailboxSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The base serializer for core.models.Mailbox.

Includes all viable fields from the model. Sets all constraints that must be implemented in all serializers. Other serializers for core.models.Mailbox 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 must not be shortened in subclasses.

model

alias of Mailbox

fields = '__all__'

Includes all fields.

read_only_fields: Final[list[str]] = ['name', 'type', 'account', 'is_healthy', 'last_error', 'last_error_occurred_at', 'created', 'updated']

The core.models.Mailbox.Mailbox.name, core.models.Mailbox.Mailbox.type, core.models.Mailbox.Mailbox.account, core.models.Mailbox.Mailbox.is_healthy, core.models.Mailbox.Mailbox.created and core.models.Mailbox.Mailbox.updated fields are read-only.

_declared_fields = {}
class api.v1.serializers.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)}
class api.v1.serializers.CorrespondentSerializer(*args, **kwargs)[source]

Bases: BaseCorrespondentSerializer

The standard serializer for a core.models.Correspondent.Correspondent.

Includes a nested serializer for the core.models.Correspondent.Correspondent.emails field.

emails

The emails are set from the core.models.EmailCorrespondent.EmailCorrespondent via :fu`core.models.EmailCorrespondent`

_declared_fields = {'emails': SerializerMethodField(read_only=True)}
get_emails(instance)[source]

Serializes the emails connected to the instance to be serialized.

Parameters:

instance (Correspondent) – The instance being serialized.

Return type:

ReturnDict[str, Any]

Returns:

The serialized emails connected to the instance to be serialized. An empty list if the the user is not authenticated.

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

Bases: Serializer

Serializer for the stats of the database.

get_email_count(value)[source]

Gets the count of emails for the user.

Return type:

int

Returns:

The number of emails belonging to the user.

Parameters:

value (dict)

get_correspondent_count(value)[source]

Gets the count of correspondents for the user.

Return type:

int

Returns:

The number of correspondents belonging to the user.

Parameters:

value (dict)

get_attachment_count(value)[source]

Gets the count of attachments for the user.

Return type:

int

Returns:

The number of attachments belonging to the user.

Parameters:

value (dict)

get_account_count(value)[source]

Gets the count of accounts for the user.

Return type:

int

Returns:

The number of accounts belonging to the user.

Parameters:

value (dict)

get_mailbox_count(value)[source]

Gets the count of mailboxes for the user.

Return type:

int

Returns:

The number of mailboxes belonging to the user.

Parameters:

value (dict)

get_daemon_count(value)[source]

Gets the count of daemons for the user.

Return type:

int

Returns:

The number of daemons belonging to the user.

Parameters:

value (dict)

_declared_fields = {'account_count': SerializerMethodField(read_only=True), 'attachment_count': SerializerMethodField(read_only=True), 'correspondent_count': SerializerMethodField(read_only=True), 'daemon_count': SerializerMethodField(read_only=True), 'email_count': SerializerMethodField(read_only=True), 'mailbox_count': SerializerMethodField(read_only=True)}
class api.v1.serializers.EmailCorrespondentSerializer(*args, **kwargs)[source]

Bases: BaseEmailCorrespondentSerializer

The serializer for correspondents from core.models.EmailCorrespondent.

Used to serialize the correspondent belonging to an email. Does not include that email.

correspondent

The correspondent is serialized by api.v1.serializers.SimpleCorrespondentSerializer.

class Meta[source]

Bases: Meta

Metadata class for the serializer.

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

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

_declared_fields = {'correspondent': BaseCorrespondentSerializer(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)     email_address = CharField(read_only=True)     email_name = CharField(help_text='The mailer name of the correspondent.', label='Mailer name', read_only=True, style={'base_template': 'textarea.html'})     real_name = CharField(allow_blank=True, help_text='The real name of the correspondent.', max_length=255, required=False)     list_id = CharField(label='List ID', read_only=True, style={'base_template': 'textarea.html'})     list_owner = CharField(read_only=True, style={'base_template': 'textarea.html'})     list_subscribe = CharField(label='List-subscribe', read_only=True, style={'base_template': 'textarea.html'})     list_unsubscribe = CharField(label='List-unsubscribe', read_only=True, style={'base_template': 'textarea.html'})     list_unsubscribe_post = CharField(label='List-unsubscribe method', read_only=True)     list_post = CharField(read_only=True, style={'base_template': 'textarea.html'})     list_help = CharField(read_only=True, style={'base_template': 'textarea.html'})     list_archive = CharField(read_only=True, style={'base_template': 'textarea.html'})}
class api.v1.serializers.EmailSerializer(*args, **kwargs)[source]

Bases: BaseEmailSerializer

The 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.correspondents foreign 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.EmailCorrespondent via get_correspondents().

class Meta[source]

Bases: Meta

Metadata class for the serializer.

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

Omit the other header fields.

get_correspondents(instance)[source]

Serializes the correspondents connected to the instance to be serialized.

Parameters:

instance (Email) – The instance being serialized.

Return type:

ReturnDict[str, Any]

Returns:

The serialized correspondents connected to the instance to be serialized.

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

Bases: BaseEmailSerializer

A complete serializer for a core.models.Email.

Includes nested serializers for the core.models.Email.Email.replies, core.models.Email.Email.attachments and core.models.Email.Email.correspondents foreign 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.

_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)}
attachments

The attachments are serialized by eonvelope.AttachmentSerializers.BaseAttachmentSerializer.BaseAttachmentSerializer.

correspondents

The emails are set from the core.models.EmailCorrespondent via get_correspondents().

get_correspondents(instance)[source]

Serializes the correspondents connected to the instance to be serialized.

Parameters:

instance (Email) – The instance being serialized.

Return type:

ReturnDict[str, Any]

Returns:

The serialized correspondents connected to the instance to be serialized.

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

Bases: BaseMailboxSerializer

The standard serializer for a core.models.Daemon.

Includes a nested serializer for the core.models.Daemon.Daemon.daemons related field.

_declared_fields = {'daemons': BaseDaemonSerializer(many=True, read_only=True):     id = BigIntegerField(label='ID', read_only=True)     interval = IntervalScheduleSerializer():         id = IntegerField(label='ID', read_only=True)         every = IntegerField(help_text='Number of interval periods to wait before running the task again', label='Number of Periods', max_value=2147483647, min_value=1)         period = ChoiceField(choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes'), ('seconds', 'Seconds'), ('microseconds', 'Microseconds')], help_text='The type of period between task runs (Example: days)', label='Interval Period')     celery_task = PeriodicTaskSerializer(read_only=True):         enabled = BooleanField(help_text='Set to False to disable the schedule', read_only=True)         last_run_at = DateTimeField(allow_null=True, help_text='Datetime that the schedule last triggered the task to run. Reset to None if enabled is set to False.', label='Last Run Datetime', read_only=True)         total_run_count = IntegerField(help_text='Running count of how many times the schedule has triggered the task', label='Total Run Count', read_only=True)     is_healthy = BooleanField(allow_null=True, label='Health status', read_only=True)     last_error = CharField(read_only=True, style={'base_template': 'textarea.html'})     last_error_occurred_at = DateTimeField(allow_null=True, label='Time of last error occurrence', read_only=True)     created = DateTimeField(label='Time of creation', read_only=True)     updated = DateTimeField(label='Time of last update', read_only=True)     uuid = UUIDField(label='UUID', read_only=True)     fetching_criterion = ChoiceField(choices=[('DAILY', 'All emails received the last DAY'), ('WEEKLY', 'All emails received the last WEEK'), ('MONTHLY', 'All emails received the last MONTH'), ('ANNUALLY', 'All emails received the last YEAR'), ('RECENT', 'All RECENT emails'), ('UNSEEN', 'All UNSEEN emails'), ('SEEN', 'All SEEN emails'), ('ALL', 'All emails'), ('NEW', 'All RECENT and UNSEEN emails'), ('OLD', 'All emails that are not RECENT'), ('FLAGGED', 'FLAGGED emails'), ('UNFLAGGED', 'All emails that are not FLAGGED'), ('DRAFT', 'All email DRAFTs'), ('UNDRAFT', 'All emails that are not DRAFTs'), ('ANSWERED', 'All ANSWERED emails'), ('UNANSWERED', 'All UNANSWERED emails'), ('DELETED', 'All DELETED emails'), ('UNDELETED', 'All UNDELETED emails'), ('KEYWORD {}', 'All emails with the given KEYWORD'), ('UNKEYWORD {}', 'All emails without the given KEYWORD'), ('LARGER {}', 'All emails LARGER than the given size'), ('SMALLER {}', 'All emails SMALLER than the given size'), ('SUBJECT {}', 'All emails with SUBJECT containing the given text'), ('BODY {}', 'All emails with BODY containing the given text'), ('FROM {}', 'All emails sent FROM the given address'), ('SENTSINCE {}', 'All emails SENT SINCE the given date')], default=EmailFetchingCriterionChoices.ALL, help_text='The selection criterion for emails to archive.')     fetching_criterion_arg = CharField(allow_blank=True, help_text='Additional value for the selection criterion.', label='Filter value', max_length=255, required=False)     mailbox = PrimaryKeyRelatedField(queryset=Mailbox.objects.all(), required=True)}
daemons

The emails are serialized by api.v1.serializers.BaseDaemonSerializer.

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

Bases: Serializer

Serializer for email file upload.

_declared_fields = {'file': FileField(required=True), 'file_format': ChoiceField(choices=<enum 'SupportedEmailUploadFormats'>, required=True)}
class api.v1.serializers.UserProfileSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

The serializer for eonvelope.models.UserProfile.

user

The eonvelope.models.UserProfile.user field is included but hidden.

class Meta[source]

Bases: object

Metadata class for the serializer.

model

alias of UserProfile

exclude = ['id']

Include the id field.

extra_kwargs = {'immich_api_key': {'write_only': True}, 'nextcloud_password': {'write_only': True}, 'paperless_api_key': {'write_only': True}}
_declared_fields = {'user': HiddenField(default=CurrentUserDefault())}

Subpackages

Submodules