helpers.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:CodeGra.de 作者: CodeGra-de 项目源码 文件源码
def filter_all_or_404(model: t.Type[Y], *criteria: t.Any) -> t.Sequence[Y]:
    """Get all objects of the specified model filtered by the specified
    criteria.

    .. note::
        ``Y`` is bound to :py:class:`psef.models.Base`, so it should be a
        SQLAlchemy model.

    :param model: The object to get.
    :param criteria: The criteria to filter with.
    :returns: The requested objects.

    :raises APIException: If no object with the given id could be found.
        (OBJECT_ID_NOT_FOUND)
    """
    return t.cast(t.Sequence[Y], _filter_or_404(model, True, criteria))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号