[Answer]-Access data from manytomanyfield in django

1👍

Have you tried querying the questions like:

questions = question.objects.filter(quizes__in=[quiz])

Or can you get the questions from the quiz side by querying:

questions = quiz.question_set.all()

that should return all the questions connected to quiz.

0👍

You should use

questions = question.objects.filter(quizes__contains=quiz)

Leave a comment