17.2.3 Anticipating Behavior Overrides

Our GCBV, when compared to Django’s GCBVs, is somewhat problematic. If we wanted to override behavior, we would be stuck overriding the entirety of the get() method, which rather defeats the purposes. Instead, we should provide multiple methods that each provide different behavior.

In the case of an object detail page, we are doing several things:

Image Getting an object (Tag, Startup, etc.) from the database

Image Building a dictionary for the template context

Setting the new object in the template context as a specific ...

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.