问题描述
3308
方法属于Entity类。我需要为大量结果设置虚拟字段。目前,我在查询对象上使用from flask import jsonify
class SomeView(MethodView):
def post(self,*args,**kwargs):
if "csv_file" not in request.files:
return jsonify({'errors': 'No csv_file key in request.files.'}),400
,但是它会迭代整个结果集,这对我来说有点昂贵。
是否有任何解决方法,因此在将每个实体转换为JSON时都设置了虚拟字段?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)