def init_relation(self, models, relation):
        """
        Initialize the relation on a set of models.

        :type models: list
        :type relation: str
        """
        for model in models:
            model.set_relation(
                relation, Result(self._related.new_collection(), self, model)
            )

        return models
def init_relation ( self , models , relation ) : for model in models : model . set_relation ( relation , Result ( self . _related . new_collection ( ) , self , model ) ) return models
Initialize the relation on a set of models.

        :type models: list
        :type relation: str