Django cannot be both deferred a
作者:
盘古_创世纪 | 来源:发表于
2020-04-04 13:38 被阅读0次
student_list = Student.objects.only('name').select_related('grades')
由于是表关联,此时没有查询关联表 grades 的任何内容, 报错
修改为:
student_list = Student.objects.only('name', 'grades__title').select_related('grades')
本文标题:Django cannot be both deferred a
本文链接:https://www.haomeiwen.com/subject/cbxjphtx.html
网友评论