dal.py 文件源码

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

项目:mybookshelf2 作者: izderadicka 项目源码 文件源码
def get_existing_conversion(ebook_id, user_id, to_format):
    format_id = await get_format_id(to_format)
    async with engine.acquire() as conn:
        source = model.Source.__table__
        conversion = model.Conversion.__table__
        res = await conn.execute(select([conversion.c.id]).select_from(conversion.join(source))\
                           .where(and_(source.c.ebook_id == ebook_id,
                                       conversion.c.created_by_id == user_id,
                                       conversion.c.format_id == format_id))\
                           .order_by(nullslast(desc(source.c.quality)))) 
        return await res.scalar()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号