环境:-
Odoo 9, Python 2.7
我有一个HTML表单,如下所示:
客户零件:-
<form method="POST">
<input type="text" name="series[1234][name]" />
<input type="text" name="series[1234][value]" />
<input type="text" name="series[1235][name]" />
<input type="text" name="series[1235][value]" />
<input type="submit" />
</form>
服务器零件:-
import http
# Other Imports
class Demo(http.Controller):
@http.route([
'/readable/url',
], type='http', auth="user", website=True)
def readable_url(self, **request):
# I am getting this
# {
# 'series[1234][name]' = 123,
# 'series[1234][value]' = 22,
# 'series[1235][name]' = 43,
# 'series[1235][value]' = 4434,
# }
# But I want like this
# series = {
# '1234' = {'name' = 123, 'value' = 22},
# '1235' = {'name' = 43, 'value' = 4434},
# }
我可以根据我的需要转换此请求,但请告诉我是否有任何预定义的方法来转换此请求。你知道吗
这里有关于github或npm的解
复制/dist/jquery.serialize-object.min.js文件内置模块结构
你知道吗资产.xml(安装lib和静态文件)
你知道吗模板.xml你知道吗
你知道吗你的jsmodule.js你知道吗
你知道吗主.py你知道吗
注意:在这种情况下,“1234”“1235”将成为一个数组
相关问题 更多 >
编程相关推荐