title: Django: Sum up Counts in one query
body: <p>I have a list of elements that i would like to rank according to the count of related manytomany elements. I think aggregating the counts of those source elements is the right way, but i haven't found a solution yet.</p>
  
  <pre><code>class Element(models.Model):
       Source1 = models.ManyToManyField(Source1)
       Source2 = models.ManyToManyField(Source2)
       Source3 = models.ManyToManyField(Source3)
  
  
  Ranked = (Element.objects.all().aggregate(
           Ranked=Sum(F('Source1') + F('Source2') + F('Source3'), output_field=IntegerField)['Ranked']
  ))
  </code></pre>