web.views.mailbox_views package¶
web.views.mailbox_views package containing views for the core.models.Mailbox data.
- class web.views.mailbox_views.MailboxCreateDaemonView(**kwargs)[source]¶
Bases:
LoginRequiredMixin,DetailView,BaseFormViewView for creating a single
core.models.Daemoninstance.- URL_NAME = 'mailbox-create-daemon'¶
- form_class¶
alias of
CreateMailboxDaemonForm
- template_name = 'web/mailbox/mailbox_daemon_create.html'¶
- get_queryset()[source]¶
Restricts the queryset to objects owned by the requesting user.
- Return type:
- get_form(form_class=None)[source]¶
Return an instance of the form to be used in this view.
- Return type:
- Parameters:
form_class (type[CreateMailboxDaemonForm] | None)
- get_success_url()[source]¶
Return the URL to redirect to after processing a valid form.
- Return type:
- form_valid(form)[source]¶
If the form is valid, save the associated model.
- Return type:
- Parameters:
form (CreateMailboxDaemonForm)
- get(request, *args, **kwargs)[source]¶
Handle GET requests: instantiate a blank version of the form.
- Return type:
- Parameters:
- class web.views.mailbox_views.MailboxDetailWithDeleteView(**kwargs)[source]¶
Bases:
LoginRequiredMixin,DetailWithDeleteView,CustomActionMixin,TestActionMixinView for a single
core.models.Mailboxinstance.- URL_NAME = 'mailbox-detail'¶
- template_name = 'web/mailbox/mailbox_detail.html'¶
- success_url = '/mailboxes/'¶
- get_queryset()[source]¶
Restricts the queryset to objects owned by the requesting user.
- Return type:
- 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:
request (
HttpRequest) – The post request to handle.args (Any)
kwargs (Any)
- Return type:
- 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_fetch(request)[source]¶
Handler function for the fetch action.
- Parameters:
request (
HttpRequest) – The action request to handle.- Return type:
- Returns:
A template response with the updated view after the action.
- class web.views.mailbox_views.MailboxEmailsFilterView(**kwargs)[source]¶
Bases:
EmailFilterView,SingleObjectMixinView for filtering listed
core.models.Emailinstances belonging to a certain mailbox.- URL_NAME = 'mailbox-emails'¶
- template_name = 'web/mailbox/mailbox_email_filter_list.html'¶
- class web.views.mailbox_views.MailboxEmailsTableView(**kwargs)[source]¶
Bases:
SingleTableMixin,MailboxEmailsFilterViewView for tabling
core.models.Emailinstances belonging to a certain mailbox.- URL_NAME = 'mailbox-emails-table'¶
- template_name = 'web/mailbox/mailbox_email_table.html'¶
- table_class¶
alias of
BaseEmailTable
- class web.views.mailbox_views.MailboxFilterView(**kwargs)[source]¶
Bases:
LoginRequiredMixin,FilterPageViewView for filtering listed
core.models.Mailboxinstances.- URL_NAME = 'mailbox-filter-list'¶
- template_name = 'web/mailbox/mailbox_filter_list.html'¶
- context_object_name = 'mailboxes'¶
- filterset_class¶
alias of
MailboxFilterSet
- ordering = ['-is_favorite', 'account__mail_address', 'name']¶
- class web.views.mailbox_views.MailboxTableView(**kwargs)[source]¶
Bases:
SingleTableMixin,MailboxFilterViewView for filtering a table of
core.models.Mailboxinstances.- URL_NAME = 'mailbox-table'¶
- template_name = 'web/mailbox/mailbox_table.html'¶
- table_class¶
alias of
BaseMailboxTable
- class web.views.mailbox_views.MailboxUpdateOrDeleteView(**kwargs)[source]¶
Bases:
LoginRequiredMixin,UpdateOrDeleteViewView for updating or deleting a single
core.models.Mailboxinstance.- URL_NAME = 'mailbox-edit'¶
- form_class¶
alias of
BaseMailboxForm
- template_name = 'web/mailbox/mailbox_edit.html'¶
- delete_success_url = '/mailboxes/'¶
The URL to redirect to after deletion. Must be set.
- class web.views.mailbox_views.UploadEmailView(**kwargs)[source]¶
Bases:
LoginRequiredMixin,DetailView,FormViewView for uploading email and mailbox files to a mailbox.
- URL_NAME = 'mailbox-upload'¶
- context_object_name = 'mailbox'¶
- form_class¶
alias of
UploadEmailForm
- template_name = 'web/mailbox/upload_email.html'¶
- get_success_url()[source]¶
Gets the success_url of the upload.
- Return type:
- Returns:
The detail url of the mailbox.
- get_queryset()[source]¶
Restricts the queryset to objects owned by the requesting user.
- Return type:
- form_valid(form)[source]¶
Runs when the request form data is valid.
- Parameters:
form (
UploadEmailForm) – The form of the request data.- Return type:
- Returns:
A
django.http.HttpResponseredirecting tosuccess_url.
- form_invalid(form)[source]¶
Runs when the request form data is invalid.
Note
This override is required to reconcile
FormViewandDetailView.- Parameters:
form (
UploadEmailForm) – The form of the request data.- Return type:
- Returns:
A
django.http.HttpResponseredirecting tosuccess_url.
Submodules¶
- web.views.mailbox_views.MailboxCreateDaemonView module
- web.views.mailbox_views.MailboxDetailWithDeleteView module
- web.views.mailbox_views.MailboxEmailsFilterView module
- web.views.mailbox_views.MailboxEmailsTableView module
- web.views.mailbox_views.MailboxFilterView module
- web.views.mailbox_views.MailboxTableView module
- web.views.mailbox_views.MailboxUpdateOrDeleteView module
- web.views.mailbox_views.UploadEmailView module