Django cannot be both deferred and traversed using select_related at the same time
student_list=Student.objects.only('name').select_related('grades')由于是表关联,此时没有查询关联表grades的任何内容,报错修改为:student_list=Student.objects.only('name','grades__title').select_related('grades')