def find_or_fail(self, id, columns=None):
        """
        Find a model by its primary key or raise an exception

        :param id: The primary key value
        :type id: mixed

        :param columns: The columns to retrieve
        :type columns: list

        :return: The found model
        :rtype: orator.Model

        :raises: ModelNotFound
        """
        result = self.find(id, columns)

        if isinstance(id, list):
            if len(result) == len(set(id)):
                return result
        elif result:
            return result

        raise ModelNotFound(self._model.__class__)
def find_or_fail ( self , id , columns = None ) : result = self . find ( id , columns ) if isinstance ( id , list ) : if len ( result ) == len ( set ( id ) ) : return result elif result : return result raise ModelNotFound ( self . _model . __class__ )
Find a model by its primary key or raise an exception

        :param id: The primary key value
        :type id: mixed

        :param columns: The columns to retrieve
        :type columns: list

        :return: The found model
        :rtype: orator.Model

        :raises: ModelNotFound