У меня есть этот код в моем html
<form method="post" id="DogForm" action="/studentbehavior/" class="myform" style="width: 100%" enctype="multipart/form-data">{% csrf_token %}
<table class="tblcore">
<input type="hidden" value="{{teacher}}" name="teacher">
<tr>
<td rowspan="2" colspan="2">Core Values</td>
{% for core in corevalues %}
<td colspan="8"><input type="hidden" value="{{core.id}}" name="core">{{core.Description}}</td>
{% endfor %}
</tr>
<tr>
{% for corevalues in corevaluesperiod %}
<td colspan="4" style="font-size: 12px"><input type="hidden" value="{{corevalues.id}}" name="coredescription">{{corevalues.Description}}</td>
{% endfor %}
</tr>
<tr>
<td colspan="2">Student's Name</td>
{% for corevalues in period %}
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
<td colspan="4">
<input type="hidden" value="{{corevalues.id}}" name="coreperiod">Q {{corevalues.id}}
</td>
{% endfor %}
</tr>
{% for students in student %}
<tr>
<td colspan="2" class="names"><input type="hidden" value="{{students.id}}" name="student">{{students.Students_Enrollment_Records.Students_Enrollment_Records.Students_Enrollment_Records.Student_Users}}</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}" >{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option >--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
<td colspan="4">
<select name="marking">
<option>--------</option>
{% for m in marking %}
<option value="{{m.Marking}}">{{m.Marking}}</option>
{% endfor %}
</select>
</td>
</tr>
{% endfor %}
</table>
<input type="submit" value="Insert" id="submit">
</form>
Вот как это выглядит в веб-представлении

это мой код в моих представлениях, где вставленные данные
def studentbehavior(request):
id = request.POST.get('teacher')
teacher = EmployeeUser(id=id)
coreid = request.POST.get('core')
core = CoreValues(id=coreid)
corevalues = []
for corevaluesid in request.POST.getlist('coredescription'):
corevalues.append(corevaluesid)
coreperiodID = request.POST.get('coreperiod')
coreperiod = gradingPeriod(id = coreperiodID)
marking = []
for markingID in request.POST.getlist('marking'):
marking.append(markingID)
print(marking.append(markingID))
for m in request.POST.getlist('marking'):
for student in request.POST.getlist('student'):
students = StudentPeriodSummary(id=student)
#s = marking[m]
for desc in request.POST.getlist('coredescription'):
coredescription = CoreValuesDescription(id=desc)
V_insert_data = StudentsCoreValuesDescription(
Teacher=teacher,
Core_Values=coredescription,
Marking=m,
Students_Enrollment_Records=students,
grading_Period=coreperiod,
)
V_insert_data.save()
return render(request, "Homepage/updatebehavior.html")
это моя проблема, все пометки, сохраненные в базе данных, даже если я выбрал только одну в поле выбора (в представлении администратора), выглядят как ввод данных в базу данных неверен.

Это мой ответ на вопрос
ОБНОВЛЕНИЕ
КОГДА я пытаюсь ответить на вопрос mr@Saisiva A
for m, student, desc in zip(request.POST.getlist('marking'), request.POST.getlist('student'),
request.POST.getlist('coredescription')):
coredescription = CoreValuesDescription(id=desc)
students = StudentPeriodSummary(id=student)
V_insert_data = StudentsCoreValuesDescription(
Teacher=teacher,
Core_Values=coredescription,
Marking=m,
Students_Enrollment_Records=students,
grading_Period=coreperiod,
)
V_insert_data.save()
это данные, которые я ввел

это результат, который я получил на своем административном сайте

Обновление
Я выбираю отметку для каждого учащегося и каждого основного значения, а затем отправляю все данные обратно на сервер
Если я хочу ввести вот так

результат, вставленный в мою базу данных, похож на это

ОБНОВЛЕНИЕ СНОВА, когда я пытаюсь добавить это к своим представлениям
for markingID in request.POST.getlist('marking'):
marking.append(markingID)
print(marking[m])
ошибка говорит
индексы списка должны быть целыми числами или ломтиками, а не str