【发布时间】:2016-01-30 21:37:34
【问题描述】:
我正在使用 jqGrid 进行搜索查询。我的参数如下:
function:GL
_search:true
nd:1446209493437
rows:50
page:1
sidx:datetime
sord:asc
filters:{"groupOp":"AND","rules":[{"field":"username","op":"eq","data":"user"},{"field":"description","op":"nc","data":"utility"}]}
searchField:
searchString:
searchOper:
当我使用这些值在本地运行脚本时,它可以正常工作,但是当我使用网页和 cgi 时:
C:\wamp\www\ISaidItBest\assets\cgi-bin\app\Log.py in getAllLogs(self=<app.Log.Log object>)
91 elif filters: # filter options
92 buildwhere = ""
=> 93 rules = filters['rules']
94 for idx in range(len(rules)):
95 field = rules[idx]['field']
rules undefined, filters = '{"groupOp":"AND","rules":[{"field":"username","o...ield":"description","op":"nc","data":"utility"}]}'
TypeError: string indices must be integers
args = ('string indices must be integers',)
with_traceback = <built-in method with_traceback of TypeError object>
【问题讨论】:
标签: python string dictionary integer indices