web.views.mailbox_views.MailboxCreateDaemonView module

Module with the web.views.DaemonUpdateView view.

class web.views.mailbox_views.MailboxCreateDaemonView.MailboxCreateDaemonView(**kwargs)[source]

Bases: LoginRequiredMixin, DetailView, BaseFormView

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

URL_NAME = 'mailbox-create-daemon'
model

alias of Mailbox

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:

QuerySet

get_context_data(**kwargs)[source]

Insert the single object into the context dict.

Return type:

dict[str, Any]

Parameters:

kwargs (Any)

get_form_kwargs()[source]

Extended to add the user to the form kwargs.

Return type:

dict[str, Any]

get_form(form_class=None)[source]

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

Return type:

Any

Parameters:

form_class (type[CreateMailboxDaemonForm] | None)

get_success_url()[source]

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

Return type:

str

form_valid(form)[source]

If the form is valid, save the associated model.

Return type:

HttpResponse

Parameters:

form (CreateMailboxDaemonForm)

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

Handle GET requests: instantiate a blank version of the form.

Return type:

HttpResponse

Parameters:
  • request (HttpRequest)

  • args (Any)

  • kwargs (Any)

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

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

Return type:

HttpResponse

Parameters:
  • request (HttpRequest)

  • args (Any)

  • kwargs (Any)