将值列表从html按钮传递到python脚本

将值列表从html按钮传递到python脚本,python,html,django,Python,Html,Django,我有一个html模板,如: <button id="demo-btn-" >Pack</button> <table class="table table-striped"> <thead> <tr> <th><input type="checkbox" onClick="toggle(this, 'no')"></th> <

我有一个html模板,如:

<button id="demo-btn-" >Pack</button>
<table class="table table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" onClick="toggle(this, 'no')"></th>
            <th>Invoice</th>
            <th>User</th>
            <th>Order date</th>
            <th>Amount</th>
            <th>Status</th>
            <th>Tracking Number</th>
        </tr>
    </thead>
    <tbody>
    {% for oid,dbd,stts,tp in new_orders %}
        <tr>
            <td><input type="checkbox" name="no" value="{{oid}}"></td>
            <td><a class="btn-link" href="#">{{oid}}</a></td>
            <td>Steve N. Horton</td>
            <td><span class="text-muted"><i class="fa fa-clock-o"></i>{{dbd}} </span></td>
            <td>{{tp}}</td>
            <td>{{stts}}</td>
            <td>-</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
当我选中中的复选框时,中的所有复选框均已选中。现在我想,当我选中复选框并按下pack按钮时,每行的oid值都应该传递给django视图。怎么做

编辑:


我想将多个OID作为列表传递给python脚本。如果我可以将这些作为列表传递到django应用程序的视图文件中,我就可以做到这一点。我不知道如何将列表或值传递给django应用程序。

您的问题不清楚。如果您将此代码包装在一个元素中,并将按钮设置为submit,那么您描述的内容将已经发生。你到底在问什么?你可以在表单提交之前对表单值使用序列化