web.views.daemon_views package

web.views.daemon_views package containing views for the core.models.Daemon data.

class web.views.daemon_views.DaemonCreateView(**kwargs)[source]

Bases: LoginRequiredMixin, CreateView

View for creating a single core.models.Daemon instance.

URL_NAME = 'daemon-create'
model

alias of Daemon

form_class

alias of CreateDaemonForm

template_name = 'web/daemon/daemon_create.html'
get_form_kwargs()[source]

Extended to add the user to the form kwargs.

Return type:

dict[str, Any]

class web.views.daemon_views.DaemonDetailWithDeleteView(**kwargs)[source]

Bases: LoginRequiredMixin, DetailWithDeleteView, CustomActionMixin, TestActionMixin

View for a single core.models.Daemon instance.

URL_NAME = 'daemon-detail'
model

alias of Daemon

template_name = 'web/daemon/daemon_detail.html'
success_url = '/routines/'
get_queryset()[source]

Restricts the queryset to objects owned by the requesting user.

Return type:

QuerySet

post(request, *args, **kwargs)[source]

Creates response to a post request.

If no action matches the existing handlers, responds with Http204. Should be executed last in a custom view post method.

Parameters:
Return type:

HttpResponse

Returns:

The handlers response to the request. If no matching handler is found Http204.

Raises:

ImproperlyConfigured – If the called handler method does not return a django.http.HttpResponse.>

handle_start_daemon(request)[source]

Handler function for the start-daemon action.

Parameters:

request (HttpRequest) – The action request to handle.

Return type:

HttpResponse

Returns:

A template response with the updated view after the action.

handle_stop_daemon(request)[source]

Handler function for the stop-daemon action.

Parameters:

request (HttpRequest) – The action request to handle.

Return type:

HttpResponse

Returns:

A template response with the updated view after the action.

class web.views.daemon_views.DaemonFilterView(**kwargs)[source]

Bases: LoginRequiredMixin, FilterPageView

View for filtering listed core.models.Daemon instances.

URL_NAME = 'daemon-filter-list'
model

alias of Daemon

template_name = 'web/daemon/daemon_filter_list.html'
context_object_name = 'daemons'
filterset_class

alias of DaemonFilterSet

ordering = ['mailbox__name']
get_queryset()[source]

Restricts the queryset to objects owned by the requesting user.

Return type:

QuerySet

class web.views.daemon_views.DaemonTableView(**kwargs)[source]

Bases: SingleTableMixin, DaemonFilterView

View for filtering a table of core.models.Daemon instances.

URL_NAME = 'daemon-table'
template_name = 'web/daemon/daemon_table.html'
table_class

alias of BaseDaemonTable

get_paginate_by(table_data)[source]

Overridden to reconcile mixin and view.

Return type:

int

Parameters:

table_data (QuerySet)

class web.views.daemon_views.DaemonUpdateOrDeleteView(**kwargs)[source]

Bases: LoginRequiredMixin, UpdateOrDeleteView

View for updating or deleting a single core.models.Daemon instance.

URL_NAME = 'daemon-edit'
model

alias of Daemon

form_class

alias of BaseDaemonForm

template_name = 'web/daemon/daemon_edit.html'
delete_success_url = '/routines/'

The URL to redirect to after deletion. Must be set.

get_queryset()[source]

Restricts the queryset to objects owned by the requesting user.

Return type:

QuerySet

get_form(form_class=None)[source]

Return an instance of the form to be used in this view.

Return type:

BaseDaemonForm

Parameters:

form_class (type[BaseDaemonForm] | None)

Submodules