[Fixed]-Get record from master table if alteast one record exists in slave/child tables using django api

1👍

Did you try this?

Subject.objects.filter(question__id__isnull=False).distinct()

You might even be able to simplify it to the following, but I’m too lazy to look up if it’s correct or try it out:

Subject.objects.filter(question__isnull=False).distinct()

Leave a comment