November 2015
Beginner to intermediate
840 pages
26h 30m
English
In this section, we transform ObjectCreateMixin into a GCBV.
The ObjectCreateMixin class already provides get() and post() methods, which TagCreate, StartupCreate, and NewslinkCreate all inherit in tandem with View to be full-fledged CBVs. To turn ObjectCreateMixin into it’s own CBV, we can first rename it to CreateView and then make it inherit View, as shown in Example 17.22.
Example 17.22: Project Code
organizer/utils.py in 6b1f610347
7 class CreateView(View):
We must thus inherit the new GCBV in the relevant create views, as shown in Example 17.23.
Example 17.23: Project Code
organizer/views.py in 6b1f610347
12 from .utils import ( 13 CreateView, ObjectDeleteMixin, ...
Read now
Unlock full access