def find_or_new(self, id, columns=None):
        instance = self._query.find(id, columns)
        if instance is None:
            instance = self.get_related().new_instance()

        return instance
Find a model by its primary key or return new instance of the related model.
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to_many.py/BelongsToMany.find_or_new