我有一个表单,它有几个复选框和文本框,它们的值都由一个提交按钮传递到不同的 url。但是,我现在正在尝试编写新的 url 页面,但不知道如何访问这些值。
<form name="myform" action="result" method = "get">
<fieldset>
<input type="checkbox" value="total_money" name="check" onchange="javascript:toggle('money');" /> Filter by Total Money</br>
<div id="money" style="display:none" name="option">
<input type="checkbox" value="more" onchange="javascript:toggleLine('money_text');" name="condition"/> <label for="condition" > > </label>
<div id = "money_text" style="display:none" >
<input type="text" id="money_box" name="money_name" value="lower limit" />
</div></br>
<input type="checkbox" value="less" onClick="javascript:toggleLine('money_text1');" name="condition"/> <label for="condition1"> < </label>
<div id = "money_text1" style="display:none;" >
<input type="text" id="money_box1" name="money_name1" value="upper limit" />
</div>
</div>
<input type="checkbox" value="employees" name="check" onchange="javascript:toggle( 'employees');"/> Filter by Employees</br>
<div id="employees" style="display:none" name="option">
<input type="checkbox" value="more" onchange="javascript:toggleLine('employees_text');" name="condition"/> <label for="condition" > > </label>
<div id = "employees_text" style="display:none" >
<input type="text" id="employees_box" name="employees_name" value="lower limit" />
</div></br>
<input type="checkbox" value="less" onClick="javascript:toggleLine('employees_text1');" name="condition"/> <label for="condition1"> < </label>
<div id = "employees_text1" style="display:none;" >
<input type="text" id="employees_box1" name="employees_name1" value="upper limit" />
</div>
</div>
</fieldset>
<input type="submit" value="Submit" />
</form>
我得到的 url 响应看起来像这样(取决于检查或不检查的内容/输入):
url: http://127.0.0.1:8000/crunchApp/result?check=total_money&condition=more&money_name=lower+limit&money_name1=upper+limit&check=employees&employees_name=lower+limit&condition=less&employees_name1=upper+limit
我需要将此标准用作搜索数据库但似乎无法弄清楚的python方法的参数。任何帮助将不胜感激!