web.views.attachment_views package

web.views.attachment_views package containing views for the core.models.Attachment data.

class web.views.attachment_views.AttachmentDetailWithDeleteView(**kwargs)[source]

Bases: LoginRequiredMixin, DetailWithDeleteView, CustomActionMixin

View for a single core.models.Attachment instance.

URL_NAME = 'attachment-detail'
model

alias of Attachment

template_name = 'web/attachment/attachment_detail.html'
success_url = '/attachments/'
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_share(request)[source]

Handler function for the share 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.attachment_views.AttachmentFilterView(**kwargs)[source]

Bases: LoginRequiredMixin, FilterPageView

View for filtering listed core.models.Attachment instances.

URL_NAME = 'attachment-filter-list'
model

alias of Attachment

template_name = 'web/attachment/attachment_filter_list.html'
context_object_name = 'attachments'
filterset_class

alias of AttachmentFilterSet

ordering = ['-is_favorite', 'file_name']
get_queryset()[source]

Restricts the queryset to objects owned by the requesting user.

Return type:

QuerySet

class web.views.attachment_views.AttachmentTableView(**kwargs)[source]

Bases: SingleTableMixin, AttachmentFilterView

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

URL_NAME = 'attachment-table'
template_name = 'web/attachment/attachment_table.html'
table_class

alias of BaseAttachmentTable

get_paginate_by(table_data)[source]

Overridden to reconcile mixin and view.

Return type:

int

Parameters:

table_data (QuerySet)

Submodules