addon.py 文件源码

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

项目:mccurse 作者: khardix 项目源码 文件源码
def with_id(cls, connection: SQLSession, id: int) -> 'Mod':
        """Fetch mod with id from database.

        Keyword arguments:
            connection: Database connection to fetch from.
            id: The id field of the mod to get.

        Returns:
            The requested mod.

        Raises:
            NoResultFound: Mod with specified id does not exist.
        """

        query = SQLBakery(lambda conn: conn.query(cls))
        query += lambda q: q.filter(cls.id == bindparam('id'))

        return query(connection).params(id=id).one()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号