models.py 文件源码

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

项目:aiohttp_json_api 作者: vovanbo 项目源码 文件源码
def cte_constructor(cls, where=None, limit=None, offset=None, name=None) -> CTE:
    query = cls.Options.db_table.select()
    if where is not None:
        query = query.where(where)
    if limit is not None:
        query = query.limit(limit)
    if offset is not None:
        query = query.offset(offset)

    name = name or '{}_cte'.format(inflection.tableize(cls.__name__))
    return query.cte(name=name)


# With NamedTuple we can't use mixins normally,
# so use classmethod() call directly
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号