core.models.EmailCorrespondent module¶
Module with the EmailCorrespondent model class.
- class core.models.EmailCorrespondent.EmailCorrespondent(*args, **kwargs)[source]¶
Bases:
ExportModelOperationsMixin('email_correspondent'),URLMixin,TimestampModelMixin,ModelDatabase model for connecting emails and their correspondents.
- BASENAME = 'email'¶
Direct user to email endpoints.
- DELETE_NOTICE = 'This will delete the records of this email and all its attachments but not its correspondents.'¶
- DELETE_NOTICE_PLURAL = 'This will delete the records of these emails and all their attachments but not their correspondents.'¶
- email¶
The email
correspondentwas mentioned in. Unique together withcorrespondentandmention.
- mention¶
The mention of
correspondentinemail. Unique together withemailandcorrespondent.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for EmailCorrespondent>¶
- correspondent_id¶
- created¶
The datetime the model instance was created. Is set automatically.
- email_id¶
- get_mention_display(*, field=<django.db.models.fields.CharField: mention>)¶
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- updated¶
The datetime the model instance entry was last updated. Is set automatically.
- __str__()[source]¶
Returns a string representation of the model data.
- Return type:
- Returns:
The string representation of the emailcorrespondent, using
email,correspondentandmention.
- classmethod create_from_header(header, header_name, email)[source]¶
Prepares a list
core.models.EmailCorrespondentfrom an email header.- Parameters:
- Return type:
- Returns:
The list of
core.models.EmailCorrespondentinstances with data from the header. If the correspondent already exists in the db. None if the correspondent could not be parsed.- Raises:
ValueError – If the email argument is not in the db.