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
评论列表
文章目录