As a anecdotal data point, when I getting started with class-based views I put everything into get_context_data method, because that’s where I thought the code for constructing the context should go. I eventually figured out that I should probably never override that method, but rather override get() or post(), etc, and _call_ it with the context I desired.
Having some better documentation of what the Right Way to subclass these views would have been a great help. The fact that the documentation is fragmented because of the mixin inheritance definitely makes understanding how to use those generic class based views more challenging. I’m not sure what magical visualization would make the proper override methods obvious, but if there was one, I think it would definitely have helped me grok how to use class-based views effectively. > On Mar 17, 2015, at 6:40 PM, Curtis Maloney <[email protected]> > wrote: > > No... I'm well aware of CCBV, and think it's a great tool... however, I had > in mind something that would more clearly show (a) the stratified layers of > interface, and (b) the typical call paths [through the layers] of the various > Views and Mixins. > > Such a visualisation, I feel, would help many people more readily grasp how > all the pieces fit together, and where to hook in to get the results they > want. > > -- > C > > > On 18 March 2015 at 10:19, Russell Keith-Magee <[email protected] > <mailto:[email protected]>> wrote: > > On Wed, Mar 18, 2015 at 5:38 AM, Curtis Maloney <[email protected] > <mailto:[email protected]>> wrote: > I found when taking the CBGV session in MelbDjango School, it was best to > approach teaching CBV as an exercise in Interfaces. > > Once the students were familiar with writing basic views, and the patterns > therein, much of CBGV became "obvious", and the lesson focused more on the > power of interfaces. > > As I've said many times on IRC I'd love a site that shows the layers of > interfaces in various CBGV so it becomes clearer how they interact. > Unfortunately, I don't have the time or skills to pull this off :/ > > > You mean something like: > > http://ccbv.co.uk <http://ccbv.co.uk/> > > or did you have something else in mind? > > Yours, > Russ Magee %-) > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/django-developers > <http://groups.google.com/group/django-developers>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CAJxq848-7%3D%2BL_foUTvkH3rDw1n_c-zDbpqUtkHdVA0wKJbY3_w%40mail.gmail.com > > <https://groups.google.com/d/msgid/django-developers/CAJxq848-7%3D%2BL_foUTvkH3rDw1n_c-zDbpqUtkHdVA0wKJbY3_w%40mail.gmail.com?utm_medium=email&utm_source=footer>. > > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/django-developers > <http://groups.google.com/group/django-developers>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CAG_XiSBb3iT9RXS87HHY2WJekR53LuDbTpCZ_sW3%3DhmyRA-sTA%40mail.gmail.com > > <https://groups.google.com/d/msgid/django-developers/CAG_XiSBb3iT9RXS87HHY2WJekR53LuDbTpCZ_sW3%3DhmyRA-sTA%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/E5DF520E-6EED-4E2B-8230-20CF6D77EF95%40ryanhiebert.com. For more options, visit https://groups.google.com/d/optout.
