def num_products(self, start_date, end_date):
    return self.product_set.filter(review__time__range=[start_date, end_date]
        ).count()
Django: how to annotate queryset with count of filtered ForeignKey field?