async def load_fk(self, info: SQLQueryInfo, records: Iterable[DataRecord]) -> Union[List, Iterable]:
<EOL>async def check(data, records):<EOL><INDENT>for column, fkvalues_lst in data.items():<EOL><INDENT>for fkvalues in fkvalues_lst:<EOL><INDENT>pks = []<EOL>all_ni = True<EOL>vcls = self.app.tables[fkvalues['<STR_LIT>']]<EOL>for i in records:<EOL><INDENT>val = i.get(column, NotImplemented)<EOL>if val != NotImplemented:<EOL><INDENT>all_ni = False<EOL><DEDENT>pks.append(val)<EOL><DEDENT>if all_ni:<EOL><INDENT>logger.debug("<STR_LIT>" % column)<EOL>continue<EOL><DEDENT>v = vcls(self.app, self._request)  <EOL>await v._prepare()<EOL>info2 = SQLQueryInfo()<EOL>info2.set_select(ALL_COLUMNS)<EOL>info2.add_condition(PRIMARY_KEY, SQL_OP.IN, pks)<EOL>info2.bind(v)<EOL>try:<EOL><INDENT>fk_records, count = await v._sql.select_page(info2, size=-<NUM_LIT:1>)<EOL><DEDENT>except RecordNotFound:<EOL><INDENT>continue<EOL><DEDENT>await v.check_records_permission(info2, fk_records)<EOL>fk_dict = {}<EOL>for i in fk_records:<EOL><INDENT>fk_dict[i[vcls.primary_key]] = i<EOL><DEDENT>column_to_set = fkvalues.get('<STR_LIT>', column) or column<EOL>for _, record in enumerate(records):<EOL><INDENT>k = record.get(column, NotImplemented)<EOL>if k in fk_dict:<EOL><INDENT>record[column_to_set] = fk_dict[k]<EOL><DEDENT><DEDENT>if fkvalues['<STR_LIT>']:<EOL><INDENT>await check(fkvalues['<STR_LIT>'], fk_records)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>await check(info.loadfk, records)<EOL>return records<EOL>
:param info:
:param records: the data got from database and filtered from permission
:return: