Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Element(models.Model):
  2. Source1 = models.ManyToManyField(Source1)
  3. Source2 = models.ManyToManyField(Source2)
  4. Source3 = models.ManyToManyField(Source3)
  5.  
  6.  
  7. Ranked = (Link.objects.all().aggregate(
  8. Ranked=Sum(F('Source1') + F('Source2') + F('Source3'), output_field=IntegerField)['Ranked']
  9. ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement