CarReviews
с ForeignKey
к таблице Car
.Car
с кол-вом CarReviews
больше чем N. N - переменная. class CarRewiews(models.Model):
car = models.ForeignKey(Car, verbose_name=_('Car'), related_name='car_rewiews')
class Car(models.Model):
somefield = models.TextField()
from django.db.models import Count
Car.objects.annotate(reviews_count=Count('car_rewiews')).filter(reviews_count__gt=N)