我正在使用django创建考勤管理系统,我想从一个表中检索学生的姓名并将其发送到另一个表中。 如何检索隐藏的输入数据并用于填充数据库?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>Welcome To Homepage</h1>
<form action="" method="post">
{% csrf_token %}
<table>
<tr>
<th>Name</th>
<th>Class</th>
<th>status</th>
</tr>
{% for i in object_list %}
<tr>
<td>{{i.name}}
<input type="hidden" value="{{i.name}}"></td>
<td> {{i.std}}
<input type="hidden" value="{{i.std}}"></td>
<td><input type="radio" value ='male' name="gender">Male
<input type="radio" value = 'female' name="gender">female
</td>
</tr>
{%endfor%}
</table>
<input type="submit" value="submit">
</form>
<a href="{% url 'login' %}">login</a>
</body>
</html>