3 ms·
It won't help you with handling code size so big you really want types, but one advice I would give is ditch class based views. I find that function views much
by wolf550e 9y ago
It won't help you with handling code size so big you really want types, but one advice I would give is ditch class based views. I find that function views much easier to reason about, even if it leads to code duplication. The ability to read the code linearly without jumping through inheritance hierarchies makes everything better.
- brianwawok 9y agoMe too. I never got CBV. I usually use more than one model in a view.
- bebop 9y agoThere are TemplateView and View that give you all the good stuff of CBV's without needing to use the more tailored versions. That way instead of needing to do if request.method == 'GET': something() elif request.method == 'POST': save() you can just override the get and post method, and do all the init stuff in dispatch. I have found this to be a really clean way to deal with views that need to do more than what the CBV's give by default.