Checkbox 多重选择列表 Template
>>> check_box.html
<html> <body> <p>Testing Project for OSU/CSD</p> <form action="" method="POST"> {%for item in options%} <input type="checkbox" value="1" name="check_box_list"/>{{item}} <br> {%endfor%} <input type="submit" value="提交"/> </form> </body> </html>
>>> views.py
def checkList(request): ... t = get_template("check_box.html") someList = getSomeList() html = t.render(Context({"options": someList})) return HttpResponse(html)
浙公网安备 33010602011771号