November 2015
Beginner to intermediate
840 pages
26h 30m
English
A generic view is a view that provides behavior but that cannot work unless a developer configures it. A GCBV is a generic view that is also class-based. However, Django does not supply generic function views (anymore).
Django introduced the concept of generic views even before version 1.0. At the time, all of the views were functions. The problem with functions as generic views is that they are difficult to override. To demonstrate, we can build our own generic function view.
Our model_list() view, shown in Example 17.20, is built to replace basic listing behavior, as exhibited by TagList or StartupList. As with our custom DetailView, we derive all of the necessary information from the _meta attribute ...
Read now
Unlock full access