query Payer objects filter payment__date__year year payment__date__mon

1
query = Payer.objects.filter(payment__date__year=year, payment__date__month=month, payment__tax__category__name=category).annotate(amount=Sum('payment__amount'))