Listy¶
Założenia¶
Moduł odpowiedzialny za indywidualny komunikat wymieniony pomiedzy systemem, a urzędem. Zapewnia odbiór korespondencji w formie e-mailowej wraz z załącznikami i jej publikacji.
Odbiór korespondencji w formie e-mailowej realizowany jest z wsparciem aplikacji imap-to-webhook .
Dane testowe¶
Dla modułu nie możliwe jest w środowisku deweloperskim dynamicznie wygenerowanie generowanych danych testowych.
Todo
Opracować generowanie danych testowych.
Architektura¶
Model¶
- class feder.letters.models.Attachment(id, created, modified, attachment, letter, text_content, text_content_update_result)[source]¶
- Parameters:
id (AutoField) – Id
created (CreationDateTimeField) – Utworzono
modified (ModificationDateTimeField) – Zmodyfikowany
attachment (FileField) – Plik
letter_id (ForeignKey to
feder.letters.models.Letter) – Lettertext_content (TextField) – Treść tekstowa
text_content_update_result (TextField) – Wynik aktualizacji zawartości tekstowej
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class feder.letters.models.AttachmentQuerySet(model=None, query=None, using=None, hints=None)[source]¶
- class feder.letters.models.Letter(id, created, modified, record, author_user, author_institution, title, body, html_body, quote, html_quote, email, email_from, email_to, note, ai_evaluation, normalized_response, is_spam, is_draft, message_type, mark_spam_by, mark_spam_at, message_id_header, eml)[source]¶
- Parameters:
id (AutoField) – Id
created (CreationDateTimeField) – Utworzono
modified (ModificationDateTimeField) – Zmodyfikowany
record_id (OneToOneField to
feder.records.models.Record) – Recordauthor_user_id (ForeignKey to
feder.users.models.User) – Autor (jeżeli użytkownik)author_institution_id (ForeignKey to
feder.institutions.models.Institution) – Autor (jeżeli instytucja)title (CharField) – Temat
body (TextField) – Treść
html_body (TextField) – Treść w formacie html
quote (TextField) – Cytat
html_quote (TextField) – Cytat w formacie html
email (EmailField) – E-mail
email_from (EmailField) – Z adresu e-mail
email_to (EmailField) – Na adres e-mail
note (TextField) – Komentarz od redakcji
ai_evaluation (TextField) – Ocena ai listu
normalized_response (JSONField) – Znormalizowana odpowiedź na monitoring
is_spam (IntegerField) – Oznaczony jako spam?
is_draft (BooleanField) – Czy szkic?
message_type (IntegerField) – Typ wiadomości
mark_spam_by_id (ForeignKey to
feder.users.models.User) – Osoba, która oznaczyła jako spammark_spam_at (DateTimeField) – Czas kiedy list został oznaczony jako spam
message_id_header (CharField) – Id wysłanej wiadomości e-mail “message-id”
eml (FileField) – Plik
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- property allowed_recipient¶
Returns True if any of the recipients from Letter.get_recipients email domain is in monitoring domains.
- class feder.letters.models.LetterEmailDomain(id, created, modified, domain_name, is_trusted_domain, is_monitoring_email_to_domain, is_spammer_domain, is_non_spammer_domain, email_to_count, email_from_count)[source]¶
- Parameters:
id (AutoField) – Id
created (CreationDateTimeField) – Utworzono
modified (ModificationDateTimeField) – Zmodyfikowany
domain_name (CharField) – Domena adresu e-mail
is_trusted_domain (BooleanField) – Czy zaufana (własna lub partnerska)?
is_monitoring_email_to_domain (BooleanField) – Czy e-mail do jest z monitoringu?
is_spammer_domain (BooleanField) – Jest spamerem
is_non_spammer_domain (BooleanField) – Nie jest spamerem
email_to_count (IntegerField) – Liczba adresów email do
email_from_count (IntegerField) – Liczba adresów email od
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- save(*args, **kwargs)[source]¶
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- class feder.letters.models.MassMessageDraft(id, created, modified, letter, monitoring)[source]¶
- Parameters:
id (AutoField) – Id
created (CreationDateTimeField) – Utworzono
modified (ModificationDateTimeField) – Zmodyfikowany
letter_id (OneToOneField to
feder.letters.models.Letter) – Listmonitoring_id (ForeignKey to
feder.monitorings.models.Monitoring) – Monitoring
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class feder.letters.models.ReputableLetterEmailTLD(id, created, modified, name)[source]¶
- Parameters:
id (AutoField) – Id
created (CreationDateTimeField) – Utworzono
modified (ModificationDateTimeField) – Zmodyfikowany
name (CharField) – Renomowana domena najwyższego poziomu z adresu e-mail
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
Panel administracyjny¶
- class feder.letters.admin.AttachmentAdmin(model, admin_site)[source]¶
Admin View for Attachment
- get_queryset(request)[source]¶
Override the default get_queryset method to annotate the queryset with the latest scan_status from the related Request model.
- has_add_permission(request)[source]¶
Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.
- has_change_permission(request, obj=None)[source]¶
Return True if the given request has permission to change the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the obj model instance. If obj is None, this should return True if the given request has permission to change any object of the given type.
- has_delete_permission(request, obj=None)[source]¶
Return True if the given request has permission to delete the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the obj model instance. If obj is None, this should return True if the given request has permission to delete any object of the given type.
- class feder.letters.admin.AttachmentInline(parent_model, admin_site)[source]¶
Stacked Inline View for Attachment
- model¶
alias of
Attachment
- class feder.letters.admin.LetterAdmin(model, admin_site)[source]¶
Admin View for Letter
- has_add_permission(request)[source]¶
Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.
- has_change_permission(request, obj=None)[source]¶
Return True if the given request has permission to change the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the obj model instance. If obj is None, this should return True if the given request has permission to change any object of the given type.
- has_delete_permission(request, obj=None)[source]¶
Return True if the given request has permission to delete the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the obj model instance. If obj is None, this should return True if the given request has permission to delete any object of the given type.
Widoki¶
- class feder.letters.views.AssignLetterFormView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:assign
- form_class¶
alias of
AssignLetterForm
- class feder.letters.views.AttachmentRequestCreateView(**kwargs)[source]¶
- Parameters:
url_name –
letters:scan
- get_object(*args, **kwargs)[source]¶
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- get_queryset()[source]¶
Return the QuerySet that will be used to look up the object.
This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model¶
alias of
Attachment
- class feder.letters.views.AttachmentXSendFileView(**kwargs)[source]¶
- Parameters:
url_name –
letters:attachmenturl_name –
letters:None
- get_queryset()[source]¶
Return the QuerySet that will be used to look up the object.
This method is called by the default implementation of get_object() and may not be called if get_object() is overridden.
- model¶
alias of
Attachment
- class feder.letters.views.LetterCaseAtomFeed[source]¶
-
- subtitle(obj)¶
Encapsulate a function call and act as a proxy for methods that are called on the result of that function. The function is not evaluated until one of the methods on the result is called.
- class feder.letters.views.LetterCaseRssFeed[source]¶
- class feder.letters.views.LetterCommonMixin[source]¶
Defines get_queryset and get_permission_object methods. It should to be specified before permission related mixins.
- class feder.letters.views.LetterCreateView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:create
- form_class¶
alias of
LetterForm
- class feder.letters.views.LetterDeleteView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:delete
- class feder.letters.views.LetterDetailView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:details
- class feder.letters.views.LetterListView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:list
- class feder.letters.views.LetterMarkSpamView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:mark_spam
- get_object(*args, **kwargs)[source]¶
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- class feder.letters.views.LetterMessageXSendFileView(**kwargs)[source]¶
- Parameters:
url_name –
letters:download
- class feder.letters.views.LetterMonitoringAtomFeed[source]¶
-
- subtitle(obj)¶
Encapsulate a function call and act as a proxy for methods that are called on the result of that function. The function is not evaluated until one of the methods on the result is called.
- class feder.letters.views.LetterMonitoringRssFeed[source]¶
- description(obj)[source]¶
Encapsulate a function call and act as a proxy for methods that are called on the result of that function. The function is not evaluated until one of the methods on the result is called.
- model¶
alias of
Monitoring
- class feder.letters.views.LetterReplyView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:reply
- form_class¶
alias of
ReplyForm
- class feder.letters.views.LetterReportSpamView(**kwargs)[source]¶
- Parameters:
url_name –
letters:spam
- class feder.letters.views.LetterResendView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:resend
- class feder.letters.views.LetterSendView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:send
- class feder.letters.views.LetterUpdateView(*args, **kwargs)[source]¶
- Parameters:
url_name –
letters:update
- form_class¶
alias of
LetterForm