The preprocessors and postprocessors for each type of request accept
different arguments, but none of them has a return value (more
specifically, any returned value is ignored). Preprocessors and
postprocessors modify their arguments in-place.
所以现在在我的后处理器中,我只删除我不想要的任何键。例如:
def api_post_get_many(result=None, **kw):
for key in result.keys():
if key != 'objects':
del result[key]
当时公认的答案是正确的。然而,post和preprocessor在Flask untillet中的工作方式发生了变化。According to the documentation:
所以现在在我的后处理器中,我只删除我不想要的任何键。例如:
烧瓶延伸部分有pretty readable source code。您可以制作
GET_MANY
后处理器:我还没有测试过,但应该可以用。在
相关问题 更多 >
编程相关推荐