17.1 Introduction

Generic class-based views (GCBVs)—alternatively called class-based generic views (CBGVs)—are class-based views (CBVs) that provide behavior commonly needed for websites. They are preprogrammed CBVs that provide generic behavior.

We started down the road to creating our own GCBVs but were one step removed. We built the ObjectCreateMixin, ObjectUpdateMixin, and ObjectDeleteMixin classes, allowing for shared behavior between classes. These classes were not GCBVs because we could not invoke these classes as views—they are simply mixins.

Django’s GCBVs take the idea of class mixins and CBVs to their logical next step. Django supplies 15 ready-to-use views as well as 30 other classes to work with (once you’re advanced enough). These ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.