def match(self, models, results, relation):
        foreign = self._foreign_key

        other = self._other_key

        dictionary = {}

        for result in results:
            dictionary[result.get_attribute(other)] = result

        for model in models:
            value = getattr(model, foreign)

            if value in dictionary:
                results = Result(dictionary[value], self, model)
            else:
                results = Result(None, self, model)

            model.set_relation(relation, results)

        return models
Match the eagerly loaded results to their parents.
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to.py/BelongsTo.match