标签:offset 使用 else 循环 传递 loop python for pos
{% for auther in auther_list %}
{% if forloop.last %}
{# 这里的意思是for循环的最后一个的意思#}
<option value="{{ auther.id }}">{{ auther.auther_name }}</option>
{% else %}
<option value="{{ auther.id }}">{{ auther.auther_name }}</option>|
{% endif %}
{% endfor %}
<div class="row">
<div class="col-md-5 col-md-offset-3">
</div>
</div>
auther_list = request.POST.getlist("book_auther")
# 如果页面是多选的select或者checkbox,则后台如果想获取前台传递过来的值,则使用getlist方法
标签:offset 使用 else 循环 传递 loop python for pos
原文地址:https://www.cnblogs.com/bainianminguo/p/9625388.html