【发布时间】:2014-08-10 06:21:00
【问题描述】:
我通过PUT 发出了以下 HTTP 请求:
http://example.com/api/student?q=%7B%22filters%22:%5B%7B%22name%22:%22id%22,%22op%22:%22%3D%3D%22,%22val%22:1%7D%5D,%22disjunction%22:true%7D
查询字符串解码到的位置:
q:{"filters":[{"name":"id","op":"==","val":1}],"disjunction":true}
在我的 flask-restless 代码中,我使用以下选项创建端点:
{
'model': Student,
'methods': ['GET', 'PUT', 'PATCH', 'POST', 'DELETE'],
'preprocessors': {
'POST': [pre_post_student],
'PATCH_MANY': [pre_patch_many_student]
},
'allow_patch_many': True
},
然后我定义了一个预处理器函数:
def pre_patch_many_student(search_params=None, data=None, **kw):
# Handle group management for the given students
print search_params
但是,当针对上述请求调用该函数时,search_params 会显示为空字典。
为什么?
【问题讨论】:
标签: python flask-restless