title: Django filter query using hasattr (or something like it)
body: <p>I want to perform a filter on a model and return all objects that have a specific attribute.</p>
  
  <pre><code>model.objects.filter(hasattr(model, 'attrname'))
  </code></pre>
  
  <p>This obviously doesn't work, but not sure how to efficiently implement something siilar.</p>
  
  <p>Thanks</p>
  
  <p>EDIT</p>
  
  <p>An example of where I would use this is when a model is inherited from another</p>
  
  <pre><code>class model1(models.Model):
      ...
  
  class model2(model1):
      ...
  </code></pre>
  
  <p>if I do a <code>model1.objects.all()</code> each of the returned objects that are in <code>model2</code> will have an extra attribute</p>