从django / python中的request.POST中检索列表项 [英] retrieving list items from request.POST in django/python

查看:192
本文介绍了从django / python中的request.POST中检索列表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 request.POST 我收到一个查询字典,这个字典中的一个项目是一个列表,多个项目( pass_id
eg。

In my request.POST i am getting a query dictionary , one of the items in this dictionary is a list with multiple items (pass_id) eg.

我想检索 pass_id中的每个值并存储在一个新的列表。你能建议这个代码吗?

I want to retrieve each of the values in pass_id and store in a new list. Can you suggest the code for this?

推荐答案

http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict.getlist

request.POST.getlist('pass_id')

这篇关于从django / python中的request.POST中检索列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆