Monitoringi¶
Założenia¶
Moduł stanowi komponent, który agreguje sprawy związane z różnymi urzędami, które odnoszą się do zbiernia informacji tej samej kategorii. Zatem monitoringiem będzie np. zainteresowanie wysoką opłaty za śmieci w Polsce. Na tej postawie system tworzy liczne sprawy dla każdego urzędu, który ma być objęty badaniem.
Architektura¶
Model¶
- class feder.monitorings.models.Monitoring(id, created, modified, name, slug, user, description, subject, hide_new_cases, template, use_llm, responses_chat_context, normalized_response_template, normalized_response_answers_categories, letter_normalization_prompt_extension, letter_normalization_prompt_extension_modified, results, email_footer, notify_alert, is_public, domain)[source]¶
- Parameters:
id (AutoField) – Id
created (AutoCreatedField) – Utworzono
modified (AutoLastModifiedField) – Zmodyfikowany
name (CharField) – Nazwa
slug (AutoSlugField) – Adres url
user_id (ForeignKey to
feder.users.models.User) – Użytkownik / użytkowniczkadescription (TextField) – Opis
subject (CharField) – Temat
hide_new_cases (BooleanField) – Czy ukrywać nowe sprawy przy przypisywaniu?
template (TextField) – Użyj: {{EMAIL}} aby umieścić adres odpowiedzi, {{ADRESAT}} aby umieścić nazwę adressata.
use_llm (BooleanField) – Użyj LLM do oceny odpowiedzi
responses_chat_context (JSONField) – Kontekst odpowiedzi w monitoringu dla czatu AI
normalized_response_template (JSONField) – Znormalizowany szablon odpowiedzi
normalized_response_answers_categories (JSONField) – Znormalizowane kategorie odpowiedzi
letter_normalization_prompt_extension (TextField) – Dodatkowa instrukcja w prompcie normalizacji odpowiedzi listów
letter_normalization_prompt_extension_modified (DateTimeField) – Zmodyfikowano dodatkową instrukcję w prompcie normalizacji odpowiedzi listów
results (TextField) – Wyniki monitoringu i otrzymanych odpowiedzi
email_footer (TextField) – Podpis w stopce e-maili, w tym w odpowiedziach na e-maile
notify_alert (BooleanField) – Powiadom o nowych alertach osoby, które mogą je widzieć
is_public (BooleanField) – Czy publicznie widoczny?
domain_id (ForeignKey to
feder.domains.models.Domain) – Domena użyta do wysłania wiadomości
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class feder.monitorings.models.MonitoringGroupObjectPermission(id, permission, group, content_object)[source]¶
- Parameters:
id (AutoField) – Id
permission_id (ForeignKey to
django.contrib.auth.models.Permission) – Permissiongroup_id (ForeignKey to
django.contrib.auth.models.Group) – Groupcontent_object_id (ForeignKey to
feder.monitorings.models.Monitoring) – Content object
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class feder.monitorings.models.MonitoringQuerySet(model=None, query=None, using=None, hints=None)[source]¶
- with_case_confirmation_received_count()[source]¶
function to annotate with case count when case.confirmation_received field is True
- class feder.monitorings.models.MonitoringUserObjectPermission(id, permission, user, content_object)[source]¶
- Parameters:
id (AutoField) – Id
permission_id (ForeignKey to
django.contrib.auth.models.Permission) – Permissionuser_id (ForeignKey to
feder.users.models.User) – Usercontent_object_id (ForeignKey to
feder.monitorings.models.Monitoring) – Content object
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
Panel administracyjny¶
- class feder.monitorings.admin.MonitoringAdmin(*args, **kwargs)[source]¶
Admin View for Monitoring
- actions = None¶
- 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.monitorings.views.DraftListMonitoringView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:draftsurl_name –
monitorings:drafts
- get_object_list(obj)[source]¶
A method to return object list to additional list. This should be overriden.
- Parameters:
obj – The object the view is displaying.
- Returns:
A list of object to paginated
- Return type:
QuerySet
- Raises:
ImproperlyConfigured – The method was not overrided.
- model¶
alias of
Monitoring
- class feder.monitorings.views.LetterListMonitoringView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:lettersurl_name –
monitorings:letters
- get_object_list(obj)[source]¶
A method to return object list to additional list. This should be overriden.
- Parameters:
obj – The object the view is displaying.
- Returns:
A list of object to paginated
- Return type:
QuerySet
- Raises:
ImproperlyConfigured – The method was not overrided.
- model¶
alias of
Monitoring
- class feder.monitorings.views.MassMessageView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:mass-message
- dispatch(request, *args, **kwargs)[source]¶
Call the appropriate method after checking authentication
- form_class¶
alias of
MassMessageForm
- class feder.monitorings.views.MonitoringAnswerCategoriesPromptView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:answer-categories-prompt
- 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
Monitoring
- class feder.monitorings.views.MonitoringAnswersCategoriesView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:answers-categories
- 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
Monitoring
- class feder.monitorings.views.MonitoringAssignView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:assign
- get_filterset_kwargs(filterset_class)[source]¶
Returns the keyword arguments for instantiating the filterset.
- 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
Institution
- class feder.monitorings.views.MonitoringAutocomplete(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:autocomplete
- class feder.monitorings.views.MonitoringCasesAjaxDatatableView(**kwargs)[source]¶
View to provide table list of all Monitoring Cases with ajax data.
- Parameters:
url_name –
monitorings:monitoring_cases_table_ajax_data
- class feder.monitorings.views.MonitoringCasesTableView(**kwargs)[source]¶
View for displaying template with table of Monitoring Cases.
- Parameters:
url_name –
monitorings:monitoring_cases_table
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringCreateView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:create
- form_class¶
alias of
MonitoringForm
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringDeleteView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:delete
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringDetailView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:detailsurl_name –
monitorings:details
- get_object_list(obj)[source]¶
A method to return object list to additional list. This should be overriden.
- Parameters:
obj – The object the view is displaying.
- Returns:
A list of object to paginated
- Return type:
QuerySet
- Raises:
ImproperlyConfigured – The method was not overrided.
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringListView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:list
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringPermissionView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:perm
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringReportView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:reporturl_name –
monitorings:report
- 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.
- class feder.monitorings.views.MonitoringResponsesReportView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:responses_report
- class feder.monitorings.views.MonitoringResultsUpdateView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:results_update
- form_class¶
alias of
MonitoringResultsForm
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringResultsView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:results
- 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
Monitoring
- class feder.monitorings.views.MonitoringTemplateView(**kwargs)[source]¶
- Parameters:
url_name –
monitorings:template
- 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
Monitoring
- class feder.monitorings.views.MonitoringUpdatePermissionView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:perm-update
- form_class¶
alias of
SaveTranslatedUserObjectPermissionsForm
- class feder.monitorings.views.MonitoringUpdateView(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:update
- form_class¶
alias of
MonitoringForm
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringsAjaxDatatableView(**kwargs)[source]¶
View to provide table list of all Monitorings with ajax data.
- Parameters:
url_name –
monitorings:monitorings_table_ajax_data
- model¶
alias of
Monitoring
- class feder.monitorings.views.MonitoringsTableView(**kwargs)[source]¶
View for displaying template with Monitorings table.
- Parameters:
url_name –
monitorings:table
- class feder.monitorings.views.MultiCaseTagManagement(**kwargs)[source]¶
- Parameters:
url_name –
monitoring-case-tags-update
- class feder.monitorings.views.PermissionWizard(*args, **kwargs)[source]¶
- Parameters:
url_name –
monitorings:perm-add
- done(form_list, form_dict, *args, **kwargs)[source]¶
This method must be overridden by a subclass to process to form data after processing all steps.
- get_context_data(*args, **kwargs)[source]¶
Returns the template context for a step. You can overwrite this method to add more data for all or some steps. This method returns a dictionary containing the rendered form step. Available template context variables are:
all extra data stored in the storage backend
wizard - a dictionary representation of the wizard instance
Example:
class MyWizard(WizardView): def get_context_data(self, form, **kwargs): context = super().get_context_data(form=form, **kwargs) if self.steps.current == 'my_step_name': context.update({'another_var': True}) return context