The horizon.forms.views ModuleΒΆ

class horizon.forms.views.ModalFormMixin[source]

Bases: object

ModalFormMixin.get_context_data(**kwargs)[source]
ModalFormMixin.get_template_names()[source]
class horizon.forms.views.ModalFormView(**kwargs)[source]

Bases: horizon.forms.views.ModalFormMixin, django.views.generic.edit.FormView

The main view class from which all views which handle forms in Horizon should inherit. It takes care of all details with processing SelfHandlingForm classes, and modal concerns when the associated template inherits from horizon/common/_modal_form.html.

Subclasses must define a form_class and template_name attribute at minimum.

See Django’s documentation on the FormView class for more details.

ModalFormView.form_valid(form)[source]
ModalFormView.get_form(form_class)[source]

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

ModalFormView.get_object_display(obj)[source]

For dynamic insertion of resources created in modals, this method returns the display name of the created object. Defaults to returning the name attribute.

ModalFormView.get_object_id(obj)[source]

For dynamic insertion of resources created in modals, this method returns the id of the created object. Defaults to returning the id attribute.

Previous topic

The horizon.forms Module

Next topic

The horizon.forms.base Module

This Page