Pulling what I think is the best example from the cheat sheet:
>>> above_5 = Count("book", filter=Q(book__rating__gt=5))
>>> below_5 = Count("book", filter=Q(book__rating__lte=5))
>>> pubs = Publisher.objects.annotate(below_5=below_5).annotate(above_5=above_5)
I think you’re going to end up with something like:
avg50=Avg('scores__match_score', filter=Q(scores__range_distance="50"))
avg100=Avg('scores__match_score', filter=Q(scores__range_distance="100"))
user_list = User.objects.annotate(avg50=avg50, avg100=avg100)
Note: I’m winging this, there may be an error or 10 here - but it should be enough to get you started.