[Fixed]-Filtering ManyToManyField

1đź‘Ť

What if you remove “course = models.ManyToManyField(Course)” from class User and move it to class Course as follows “course = models.ManyToManyField(User)” and do following query:

User.objects.filter(course__name__contains=’mathématique’)


please note I have changed (Course) to (User)

Leave a comment