api.v1.serializers.DatabaseStatsSerializer module
Module with the DatabaseStatsSerializer serializer.
-
class api.v1.serializers.DatabaseStatsSerializer.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)}