title: Django filter the model on ManyToMany count with a limit specific to each object?
body: <p><a href="https://stackoverflow.com/questions/7883916/django-filter-the-model-on-manytomany-count">Django filter the model on ManyToMany count?</a></p>
  
  <p>My question is very similar to the above one, but with a difference: there's a limit to the many-to-many relationship inside the model. </p>
  
  <p>So instead of being</p>
  
  <pre><code>class Party(models.Model):
      organiser = models.ForeignKey()
      participants = models.ManyToManyField('auth.User', 
          related_name="participants")
  </code></pre>
  
  <p>It would be </p>
  
  <pre><code>class Party(models.Model):
      organiser = models.ForeignKey()
      max_participants = models.PositiveIntegerField()
      participants = models.ManyToManyField('auth.User', 
          related_name="participants")
  </code></pre>
  
  <p>So I want to find all Party objects in which the count of participants is less than <code>Party.max_participants</code>. How can I make that query using Django's ORM?</p>