api.v1.serializers.correspondent_serializers.CorrespondentSerializer module¶
Module with the CorrespondentSerializer serializer class.
- class api.v1.serializers.correspondent_serializers.CorrespondentSerializer.CorrespondentSerializer(*args, **kwargs)[source]¶
Bases:
BaseCorrespondentSerializerThe standard serializer for a
core.models.Correspondent.Correspondent.Includes a nested serializer for the
core.models.Correspondent.Correspondent.emailsfield.- emails¶
The emails are set from the
core.models.EmailCorrespondent.EmailCorrespondentvia :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:
- Returns:
The serialized emails connected to the instance to be serialized. An empty list if the the user is not authenticated.