title: Django Model Mixins: inherit from models.Model or from object?
body: <p>This is a question about Python Mixins that might be useful in general. I'm just using Django models as that is the use-case I'm most familiar with.</p>
  
  <p>Should a mixin inherit from the class it is designed to mix-in with or from 'object'?</p>
  
  <p>Examples by code, what is more correct or better, or better depending on what you want to achieve?</p>
  
  <p>This</p>
  
  <pre><code>class TaggingMixin(models.Model):
      tag = models.ForeignKey(Tag)
  
      class Meta:
          abstract = True
  
  class MyModel(models.Model, TaggingMixin):
      title = models.CharField(max_length=100)
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>class TaggingMixin(object):
      tag = models.ForeignKey(Tag)
  
      class Meta:
          abstract = True
  
  class MyModel(models.Model, TaggingMixin):
      title = models.CharField(max_length=100)
  </code></pre>
  
  <p>I think inheriting from object is the right way. But I'm seeing examples of the first case all over the net...</p>
  
  <p><strong>EDIT:</strong> I've moved my follow up question to a separate question: <a href="https://stackoverflow.com/questions/3263417/django-abstract-models-vs-simple-python-mixins-vs-python-abcs">Django Abstract Models vs simple Python mixins vs Python ABCs</a></p>