title: A django model that subclasses an abc, gives a metaclass conflict
body: <p>I have a following model and abstract base class</p>
  
  <pre><code>import abc
  from django.db import models
  
  
  class AbstractBase():
      __metaclass__ = abc.ABCMeta
  
      @abc.abstractmethod
      def my_method(self):
          return
  
  
  class MyModel(models.Model, AbstractBase):
      @abc.abstractmethod
      def my_method(self):
          return 1
  </code></pre>
  
  <p>But I am getting the following error.</p>
  
  <blockquote>
    <p>metaclass conflict: the metaclass of a derived class must be a
    (non-strict) subclass of the metaclasses of all its bases</p>
  </blockquote>
  
  <p>I think the problem here is (As it is described here <a href="http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/" rel="noreferrer">http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/</a>) that two base class has two different metaclasses so python cannot decide which metaclass to use for child object.</p>
  
  <p>In order to solve this I removed multiple inheritence and use following register method to register child class</p>
  
  <pre><code>abc.register(Child)
  </code></pre>
  
  <p>But I did not really like this approach since it looks like monkey patching.</p>
  
  <p>Is there another way to solve this problem?</p>
  
  <p>I try to assign Model metaclass to Child explicitly but it did not work.
  I am not looking for a way to solve it by writing code. I think this must be solved by changing my class structure. </p>