title: Django queryset subset with custom manager?
body: <p>I have similar models:</p>
  
  <pre><code>class BaseInfo(models.Model):
    is_active = models.BooleanField(default=True)
    # other fields..
    class Meta:
       abstract = True
  
  class Customer(BaseInfo):
     name = models.CharField(max_length=50)
     ## other fields..
  </code></pre>
  
  <p>In template I want to display a table of this model, but I want to highlight the inactive ones. So I have this fragment in template:</p>
  
  <pre><code>{% for c in customers %}
      &lt;tr {%if not c.is_active %}class="not-active" {%endif%}&gt;
        &lt;td&gt;..&lt;/td&gt;
      &lt;/tr&gt;
  {% endfor %}
  </code></pre>
  
  <p>Now next to this I want to display the NUMBER of active ones.
  I could do this in view:</p>
  
  <pre><code>all = Customer.objects.filter(name="foo")
  excludeInactive = all.filter(is_active=False)
  </code></pre>
  
  <p>and then pass both in the context.
  But I would prefer something like this in template:</p>
  
  <pre><code>{{customers.exclude_deleted.count}}
  </code></pre>
  
  <p>or maybe:
  <code>{{customers.exclude_deleted|length}}</code> ?</p>
  
  <p>I have more models which inherit this abstract class. So I think a manager on the base class could work? I just couldn't understand how to write one..<br>
  Also, what about performance? If I do two calls to <code>.filter()</code> will that result in two db queries, even though the second query is a subset of an already evaluated queryset?</p>