We could build
TagUpdate independently of each other, but if we did, we’d find that they are nearly identical. Objects of both classes are identified in views by
SlugField values, meaning that the arguments passed and the functions called internally will be identical. Similar to our
ObjectCreateMixin seen earlier in this chapter, we now build a class called
ObjectUpdateMixin to provide both
TagUpdate with their behavior.
As we did for
ObjectCreateMixin, we define the new mixin class in the
We can anticipate the needs of our class, creating the
template_name attributes we’ve previously used, as shown in Example 9.55 ...