def handle_aggregation(self, callback):
def handle(*arguments, **kw):
if arguments[1]:
raise RuntimeError('Aggregation failed due to: %s' % str(arguments[1]))
results = []
for item in arguments[0]['result']:
#if '_id' in item and isinstance(item['_id'], ObjectId):
#results.append(self.get_instance(item))
#else:
self.fill_ids(item)
results.append(edict(item))
callback(results)
return handle
评论列表
文章目录