From 3151daaa6ca31ebbb78cf178a8834a5fdf495d65 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 4 Nov 2021 15:12:08 +0100 Subject: [PATCH] [4.0.x] Refs #33263 -- Expanded release notes for DeleteView adopting FormMixin. Backport of 2c01ebb4be5d53cbf6450f356c10e436025d6d07 from main --- docs/releases/4.0.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index 9089117215c..7e6c4f62ccd 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -273,6 +273,10 @@ Generic Views deletion. In addition, this allows ``DeleteView`` to function with :class:`django.contrib.messages.views.SuccessMessageMixin`. + In accordance with ``FormMixin``, object deletion for POST requests is + handled in ``form_valid()``. Custom delete logic in ``delete()`` handlers + should be moved to ``form_valid()``, or a shared helper method, as needed. + Logging ~~~~~~~ @@ -477,6 +481,14 @@ As a side-effect, running ``makemigrations`` might generate no-op ``AlterField`` operations for ``ManyToManyField`` and ``ForeignKey`` fields in some cases. +``DeleteView`` changes +---------------------- + +:class:`~django.views.generic.edit.DeleteView` now uses +:class:`~django.views.generic.edit.FormMixin` to handle POST requests. As a +consequence, any custom deletion logic in ``delete()`` handlers should be +moved to ``form_valid()``, or a shared helper method, if required. + Miscellaneous -------------