title: How to query abstract-class-based objects in Django?
body: <p>Let's say I have an abstract base class that looks like this:</p>
  
  <pre><code>class StellarObject(BaseModel):
    title = models.CharField(max_length=255)
    description = models.TextField()
    slug = models.SlugField(blank=True, null=True)
  
    class Meta:
      abstract = True
  </code></pre>
  
  <p>Now, let's say I have two actual database classes that inherit from StellarObject</p>
  
  <pre><code>class Planet(StellarObject):
    type = models.CharField(max_length=50)
    size = models.IntegerField(max_length=10)
  
  class Star(StellarObject):
    mass = models.IntegerField(max_length=10)
  </code></pre>
  
  <p>So far, so good.  If I want to get Planets or Stars, all I do is this:</p>
  
  <pre><code>Thing.objects.all() #or
  Thing.objects.filter() #or count(), etc...
  </code></pre>
  
  <p>But what if I want to get ALL StellarObjects?  If I do:</p>
  
  <pre><code>StellarObject.objects.all()
  </code></pre>
  
  <p>It of course returns an error, because an abstract class isn't an actual database object, and therefore cannot be queried.  Everything I've read says I need to do two queries, one each on Planets and Stars, and then merge them.  That seems horribly inefficient.  Is that the only way?</p>