November 2015
Beginner to intermediate
840 pages
26h 30m
English
Startup and Tag ObjectsWe could build StartupUpdate and 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 StartupUpdate and TagUpdate with their behavior.
As we did for ObjectCreateMixin, we define the new mixin class in the organizer/utils.py file.
We can anticipate the needs of our class, creating the form_class, model, and template_name attributes we’ve previously used, as shown in Example 9.55 ...
Read now
Unlock full access