I have two Models, one that has the name Exam and one that has the name Grades
Exam has primary key id. Grades has foreign key exam_id.
I want all Exams that have a entry in the Grades table.
This is what I have:
grades = Grades.objects.all()
exams = Exam.objects.all().filter(grades__exam__id = id)
I get this error:
TypeError at /exams
id() takes exactly one argument (0 given)
Can you please help me?
The problem is that
idis a Python built-in.