Exemplo n.º 1
0
 def convert(serp):
     ents = Entity.by_id_many([r['id'] for r in serp], request.account)
     results = [ents.get(r['id']) for r in serp]
     results = [entities.to_rest_index(r) for r in results]
     return results
Exemplo n.º 2
0
 def __iter__(self):
     rows = self.lq.all()
     ids = [r[0] for r in rows]
     entities = Entity.by_id_many(ids, self.account)
     for (id, score) in rows:
         yield {"score": int(score), "entity": entities.get(id)}