-1

我有一个 django 模板,其中包含一个表和一些记录。在单选按钮上单击我想通过获取请求获取 views.py 中的特定记录值。for 循环不能正常工作..请建议

{% for request in requests %}
<tr>
<td>
<tr>
<td><input type ="text" value ={{ request.workflowId}} readonly name ="workflid" STYLE="background-color: pink;"  /></td>
    <td><input type ="text" value ={{ request.proj_name}} readonly name ="projname" STYLE="background-color: pink;"  /></td>
    <td><input type ="text" value ={{ request.task }} readonly name ="id1" STYLE="background-color: pink;"  /></td>
    <td><input type ="text" value ={{ request.date }}readonly name ="id1" STYLE="background-color: pink;"  /></td>
    <td><input type ="text" value ={{ request.enteredby }} readonly name ="id1" STYLE="background-color: pink;"  /></td>
    <td> <input type = "text" align ="center" readonly name = "status" value = {{ request.status }} STYLE="background-color: pink;"  /></td>
    <td><input type = "text" value ={{ request.assignto }} readonly name = "asgnto" STYLE="background-color: pink;" /></td>
    <td><input type = "radio" name ="radio1" onclick ="validate_values()"</td>
    </tr>
    </td>
    </tr>
    {% endfor %}
4

1 回答 1

0

method="GET"在刚刚将id 值放入 url的表单中,action="/yoururl/{{request.workflowId}}/" 您可以将特定字段值区分到您的视图中。

于 2013-11-08T10:45:58.340 回答