|
@@ -275,12 +275,26 @@ editing content:
|
|
* :class:`django.views.generic.base.TemplateResponseMixin`
|
|
* :class:`django.views.generic.base.TemplateResponseMixin`
|
|
* :class:`django.views.generic.edit.BaseDeleteView`
|
|
* :class:`django.views.generic.edit.BaseDeleteView`
|
|
* :class:`django.views.generic.edit.DeletionMixin`
|
|
* :class:`django.views.generic.edit.DeletionMixin`
|
|
|
|
+ * :class:`django.views.generic.edit.FormMixin`
|
|
|
|
+ * :class:`django.views.generic.base.ContextMixin`
|
|
* :class:`django.views.generic.detail.BaseDetailView`
|
|
* :class:`django.views.generic.detail.BaseDetailView`
|
|
* :class:`django.views.generic.detail.SingleObjectMixin`
|
|
* :class:`django.views.generic.detail.SingleObjectMixin`
|
|
* :class:`django.views.generic.base.View`
|
|
* :class:`django.views.generic.base.View`
|
|
|
|
|
|
**Attributes**
|
|
**Attributes**
|
|
|
|
|
|
|
|
+ .. attribute:: form_class
|
|
|
|
+
|
|
|
|
+ .. versionadded:: 4.0
|
|
|
|
+
|
|
|
|
+ Inherited from :class:`~django.views.generic.edit.BaseDeleteView`. The
|
|
|
|
+ form class that will be used to confirm the request. By default
|
|
|
|
+ :class:`django.forms.Form`, resulting in an empty form that is always
|
|
|
|
+ valid.
|
|
|
|
+
|
|
|
|
+ By providing your own ``Form`` subclass, you can add additional
|
|
|
|
+ requirements, such as a confirmation checkbox, for example.
|
|
|
|
+
|
|
.. attribute:: template_name_suffix
|
|
.. attribute:: template_name_suffix
|
|
|
|
|
|
The ``DeleteView`` page displayed to a ``GET`` request uses a
|
|
The ``DeleteView`` page displayed to a ``GET`` request uses a
|
|
@@ -305,6 +319,7 @@ editing content:
|
|
|
|
|
|
<form method="post">{% csrf_token %}
|
|
<form method="post">{% csrf_token %}
|
|
<p>Are you sure you want to delete "{{ object }}"?</p>
|
|
<p>Are you sure you want to delete "{{ object }}"?</p>
|
|
|
|
+ {{ form }}
|
|
<input type="submit" value="Confirm">
|
|
<input type="submit" value="Confirm">
|
|
</form>
|
|
</form>
|
|
|
|
|
|
@@ -319,4 +334,10 @@ editing content:
|
|
This view inherits methods and attributes from the following views:
|
|
This view inherits methods and attributes from the following views:
|
|
|
|
|
|
* :class:`django.views.generic.edit.DeletionMixin`
|
|
* :class:`django.views.generic.edit.DeletionMixin`
|
|
|
|
+ * :class:`django.views.generic.edit.FormMixin`
|
|
* :class:`django.views.generic.detail.BaseDetailView`
|
|
* :class:`django.views.generic.detail.BaseDetailView`
|
|
|
|
+
|
|
|
|
+ .. versionchanged:: 4.0
|
|
|
|
+
|
|
|
|
+ In older versions, ``BaseDeleteView`` does not inherit from
|
|
|
|
+ ``FormMixin``.
|