1👍
I think you’re wanting something like this:
- Filter
JobsConditions
bycondition__id
and get the associatedjob_item__jobs
as a list:
jobs_list = (JobsConditions.objects
.filter(condition__id__in=cond_array)
.values_list('job_item__jobs', flat=True))
- Filter
Jobs
by thatjobs_list
:
jobs = Jobs.objects.filter(jobs__in=jobs_list)
👤tdy
Source:stackexchange.com