Re: Class Based Views VS DRY principle

2016-11-04 Thread Artem Bernatskyy
TNX On Friday, November 4, 2016 at 5:56:56 PM UTC+2, Artem Bernatskyy wrote: > > Hello. > > Suppose i have a code (http://pastebin.com/6rUqKD8q) > > And in CBV there are a bunch of methods with EXACTLY the same code. > > My question is - can i somehow inherit them from ONE place, in order to be >

RE: Class Based Views VS DRY principle

2016-11-04 Thread Matthew Pava
Just create another CBV that factors out all of the similarities between all of the other CBVs. Then inherit from your new CBV to create your more specific ones. Basically instead of inheriting from the Django CBVs, you will inherit from your own. From: django-users@googlegroups.com [mailto:d