# filter parent based on related child name values Parent.objects.filter(related_model__id__isnull=False)