title: Inherit methods in Django rest framework
body: <p>I'm new to learning django rest framework &amp; python. I'm currently trying to inherit a few methods to which I don't know how. An alternative is I copy the same code which is code replication and against code design principles.</p>
  <p>An example of what I what to do :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Class A (models.Model)-----&gt; 
  
  field1 = models()
  field2 = models()
  field3 = models()
  field4 = models()
  
  
     @classmethod
      def method1():
         return something
  
      def method2():
         return something
  
  
  Class B (models.Model)-----&gt;
   
  field5 = models() - New field, no relation to Class A fields
  field6 = models() - New field, no relation to Class A fields
  field7 = models() - New field, no relation to Class A fields
  field8 = models() - "Here I wish to link field8 to class A so that filed8 is also referenced  while viewing Class A fields .The relation I wish to establish is Many to One using Foreign Key"
  
  
      @classmethod
      "Here I wish to execute the 2 methods from Class A that are already defined, so that when When Class B is called , the 2 methods of Class A are also executed along with the new method of Class B itself"
      
      def method3(): ----&gt; New method of class B.
         return something</code></pre>
  </div>
  </div>
  </p>