'Return the most helpful users in the past week.'

def weekly_solutions(self, request, **kwargs):

    start = (datetime.now() - timedelta(days=7))
    raw_counts = Answer.objects.exclude(solution_for=None).filter(created__gt=start).values('creator__username').annotate(Count('creator')).order_by('creator__count').reverse()[:10]
    username_to_count = {u['creator__username']: u['creator__count'] for u in raw_counts}
    profiles = Profile.objects.filter(user__username__in=username_to_count.keys())
    result = ProfileFKSerializer(instance=profiles, many=True).data
    for u in result:
        u['weekly_solutions'] = username_to_count[u['username']]
    result.sort(key=(lambda u: u['weekly_solutions']), reverse=True)
    return Response(result)
