Django 如何使用外键显示学生姓名

Django 如何使用外键显示学生姓名,django,django-views,Django,Django Views,我的views.py中有此代码 me = StudentsCoreValuesDescription.objects.filter(grading_Period = coreperiod)\ .values('Marking','Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Student_Use

我的views.py中有此代码

me = StudentsCoreValuesDescription.objects.filter(grading_Period = coreperiod)\
        .values('Marking','Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Student_Users__Firstname')\
            .distinct('Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Student_Users__Firstname').order_by('Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Students_Enrollment_Records__Student_Users__Firstname')
当我试图将其显示到html中时

{% for students in me %}
        <tr>
            <td colspan="2"><input type="hidden" value="{{students.id}}" name="student">{{students.Students_Enrollment_Records.Students_Enrollment_Records.Students_Enrollment_Records.Students_Enrollment_Records.Students_Enrollment_Records.Student_Users.Firstname}}</td>
    </tr>
{% endfor %}
我的站点中没有显示任何内容,当我尝试打印printme时,结果是


正在获取并希望在UI中显示的参数的名称不同。 请在UI学生\注册\记录\学生\注册\记录\学生\注册\记录\学生\注册\记录\学生\注册\记录\学生\用户\名字中尝试此操作

存储和显示的参数应相同。

是否尝试了_u而不是。在html模板中?取名字