ObjectUpdatedMixin. It should come as no surprise that we’re about to implement
ObjectDeleteMixin (also in
ObjectUpdatedMixin was straightforward,
ObjectDeleteMixin requires a little bit more thought.
As shown in Example 9.80, we first need to be able to identify what kind of object we are deleting, so we start by defining a
model attribute on the class. In the case of
get(), we need to render a template, so we add the
template_name attribute to our class too. For the
post() method, we won’t be using the template, because our object has been deleted. We instead need a page to redirect to, so we ...