title: django model find where count on filter is minimum
body: <p>Hi there I have A model which I save ip in four column:</p>
  <pre><code>class IPAbstract(Audit):
      first = models.PositiveSmallIntegerField(validators=[MinValueValidator(1), MaxValueValidator(254)])
      second = models.PositiveSmallIntegerField(validators=[MinValueValidator(0), MaxValueValidator(254)])
      third = models.PositiveSmallIntegerField(validators=[MinValueValidator(0), MaxValueValidator(254)])
      forth = models.PositiveSmallIntegerField(validators=[MinValueValidator(0), MaxValueValidator(254)])
  
     
  
      class Meta:
          abstract = True
  
  </code></pre>
  <p>which All my ips are start with 10.0.0.0,20.0.0.0,30.0.0.0,40.0.0.0
  I want find which my ip range has minimum rows,
  i can do this:</p>
  <pre><code>IPAbstract.objects.filter(first=10).count()
  IPAbstract.objects.filter(first=20).count()
  IPAbstract.objects.filter(first=30).count()
  IPAbstract.objects.filter(first=40).count()
  </code></pre>
  <p>and compare them to each other to find which has minimum rows.
  I want see if there is there another way to find my answer?</p>