18.2 Rapid Review of GCBV

Before we jump into the deep end, remind yourself that a GCBV is simply a CBV with predefined behavior that expects to have specific attributes or methods overridden. Using GCBVs allows for rapid development of behavior commonly found on websites.

To remind ourselves of how easy their usage is and to prepare for our modification of UpdateView, we can switch NewsLinkUpdate to inherit the GCBV, as shown in Example 18.1.

Example 18.1: Project Code

organizer/views.py in 1b77e1ab78

28   class NewsLinkUpdate(UpdateView): 29       form_class = NewsLinkForm 30       model = NewsLink 31       template_name_suffix = '_form_update'

If this code is opaque or unfamiliar, please review Chapter 17

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.