test

Django获取单选框or多选框

def signup(request):
if request.method == 'GET':
return render(request, 'signup.html')
elif request.method == 'POST':
v = request.POST.get('gender',None) #获取单选
f = request.POST.getlist('favor', None) #获取多个值,多选
print(v,f)
return render(request, 'login.html')



posted on 2020-02-06 12:45  柳条儿  阅读(73)  评论(0编辑  收藏  举报

导航