[Answered ]-Django filter get parent model based on child model value

1👍

I had tried this and got the answer

Apps.objects.annotate(all=Exists(FavouriteApps.objects.filter(Q(user__username=self.request.user.username), app_id=OuterRef('pk')))).filter(all=True)
👤Akram

Leave a comment