1👍
✅
You can filter with:
Employee.objects.filter(prizedraw__isnull=False).distinct()
This will retrieve the Employee
s for which there is at least one related PrizeDraw
record.
Source:stackexchange.com