def search(self, sosl): if self.cacheTypeDescriptions: typeDescs = self.typeDescs else: typeDescs = {} res = BaseClient.search(self, sosl) # calculate the union of the sets of record types from each record if len(res): types = reduce(lambda a,b: a|b, [getRecordTypes(r) for r in res[_tPartnerNS.searchRecords]], set()) new_types = types - set(typeDescs.keys()) if new_types: typeDescs.update(self.queryTypesDescriptions(new_types)) return [self._extractRecord(r, typeDescs) for r in res[_tPartnerNS.searchRecords]] else: return []
def search(self, sosl): if self.cacheTypeDescriptions: typeDescs = self.typeDescs else: typeDescs = {} res = BaseClient.search(self, sosl) # calculate the union of the sets of record types from each record if len(res): types = reduce(lambda a, b: a | b, [getRecordTypes(r) for r in res[_tPartnerNS.searchRecords]], set()) new_types = types - set(typeDescs.keys()) if new_types: typeDescs.update(self.queryTypesDescriptions(new_types)) return [self._extractRecord(r, typeDescs) for r in res[_tPartnerNS.searchRecords]] else: return []