[Answered ]-Django ORM multiple inner join in query

1👍

You can filter with:

Courses.objects.filter(
    coursesxtrainingp__trainingPath_id=1
)

The join on the Students model is not necessary, since we already know that the trainingPath_id is one by filtering on the CoursesXTrainingP model.


Note: normally a Django model is given a singular name, so Student instead of Students.


Note: normally the name of the fields in a Django model are written in snake_case, not PascalCase, so it should be: modification_date instead of modificationDate.

Leave a comment