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, attachment, letter, text_content, text_content_update_result)[source]
Parameters:
  • id (AutoField) – Id

  • attachment (FileField) – Plik

  • letter_id (ForeignKey to feder.letters.models.Letter) – Letter

  • text_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) – Utworzony

  • modified (ModificationDateTimeField) – Zmodyfikowany

  • record_id (OneToOneField to feder.records.models.Record) – Record

  • author_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 spam

  • mark_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.

generate_mass_letters()[source]
Uses this letter as a template for generating mass message

(it has to be defined with “mass draft” message type). prepares and returns generated letters ready for sending.

get_recipients()[source]

Returns a list of all email addresses from the “To” and “Cc” fields of the Letter eml file.

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) – Utworzony

  • 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.LetterQuerySet(model=None, query=None, using=None, hints=None)[source]
class feder.letters.models.MassMessageDraft(id, created, modified, letter, monitoring)[source]
Parameters:
exception DoesNotExist
exception MultipleObjectsReturned
class feder.letters.models.ReputableLetterEmailTLD(id, created, modified, name)[source]
Parameters:
  • id (AutoField) – Id

  • created (CreationDateTimeField) – Utworzony

  • modified (ModificationDateTimeField) – Zmodyfikowany

  • name (CharField) – Renomowana domena najwyższego poziomu z adresu e-mail

exception DoesNotExist
exception MultipleObjectsReturned

Panel administracyjny

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

class feder.letters.admin.LetterEmailDomainAdmin(model, admin_site)[source]

Admin View for LetterEmailDomain

class feder.letters.admin.ReputableLetterEmailTLDAdmin(model, admin_site)[source]

Admin View for ReputableLetterEmailTLD

Widoki

class feder.letters.views.AssignLetterFormView(**kwargs)[source]
Parameters:

url_nameletters:assign

form_class

alias of AssignLetterForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of Letter

class feder.letters.views.AttachmentRequestCreateView(**kwargs)[source]
Parameters:

url_nameletters: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_nameletters:attachment

  • url_nameletters: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]
feed_type

alias of Atom1Feed

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]
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 Case

title(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.

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(**kwargs)[source]
Parameters:

url_nameletters:create

form_class

alias of LetterForm

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

model

alias of Letter

class feder.letters.views.LetterDeleteView(*args, **kwargs)[source]
Parameters:

url_nameletters:delete

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.

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

model

alias of Letter

class feder.letters.views.LetterDetailView(**kwargs)[source]
Parameters:
  • url_nameletters:details

  • url_nameletters:details

get_context_data(**kwargs)[source]

Insert the single object into the context dict.

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 Letter

class feder.letters.views.LetterListView(**kwargs)[source]
Parameters:

url_nameletters:list

get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of Letter

class feder.letters.views.LetterMarkSpamView(**kwargs)[source]
Parameters:

url_nameletters: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.

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 Letter

class feder.letters.views.LetterMessageXSendFileView(**kwargs)[source]
Parameters:

url_nameletters:download

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 Letter

class feder.letters.views.LetterMonitoringAtomFeed[source]
feed_type

alias of Atom1Feed

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

title(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.

class feder.letters.views.LetterReplyView(**kwargs)[source]
Parameters:

url_nameletters:reply

form_class

alias of ReplyForm

forms_valid(form, inlines)[source]

If the form and formsets are valid, save the associated models.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_form_valid_message()[source]

Validate that form_valid_message is set and is either a unicode or str object.

model

alias of Letter

class feder.letters.views.LetterReportSpamView(**kwargs)[source]
Parameters:

url_nameletters:spam

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 Letter

class feder.letters.views.LetterResendView(**kwargs)[source]
Parameters:

url_nameletters:resend

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 Letter

class feder.letters.views.LetterSendView(**kwargs)[source]
Parameters:

url_nameletters:send

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 Letter

class feder.letters.views.LetterUpdateView(**kwargs)[source]
Parameters:

url_nameletters:update

form_class

alias of LetterForm

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 Letter

class feder.letters.views.ReceiveEmail(**kwargs)[source]
Parameters:

url_nameletters:webhook

class feder.letters.views.UnrecognizedLetterListView(**kwargs)[source]
Parameters:

url_nameletters:unrecognized_list

get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of Letter