title: How can I obtain the model's name or the content type of a Django object?
body: <p>Let's say I am in the save code. How can I obtain the model's name or the content type of the object, and use it?</p>
  
  <pre><code>from django.db import models
  
  class Foo(models.Model):
      ...
      def save(self):
          I am here....I want to obtain the model_name or the content type of the object
  </code></pre>
  
  <p>This code works, but I have to know the model_name:</p>
  
  <pre><code>import django.db.models
  from django.contrib.contenttypes.models import ContentType
  
  content_type = ContentType.objects.get(model=model_name)
  model = content_type.model_class()
  </code></pre>