本文整理汇总了Python中coprs.logic.complex_logic.ComplexLogic.get_queues_size方法的典型用法代码示例。如果您正苦于以下问题:Python ComplexLogic.get_queues_size方法的具体用法?Python ComplexLogic.get_queues_size怎么用?Python ComplexLogic.get_queues_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coprs.logic.complex_logic.ComplexLogic
的用法示例。
在下文中一共展示了ComplexLogic.get_queues_size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list_projects_by_group
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_queues_size [as 别名]
def list_projects_by_group(group_name, page=1):
group = ComplexLogic.get_group_by_name_safe(group_name)
query = CoprsLogic.get_multiple_by_group_id(group.id)
paginator = Paginator(query, query.count(), page)
coprs = paginator.sliced_query
return render_template(
"coprs/show/group.html",
user=flask.g.user,
coprs=coprs,
paginator=paginator,
tasks_info=ComplexLogic.get_queues_size(),
group=group
)
示例2: coprs_show
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_queues_size [as 别名]
def coprs_show(page=1):
query = CoprsLogic.get_multiple()
query = CoprsLogic.set_query_order(query, desc=True)
paginator = helpers.Paginator(query, query.count(), page)
coprs = paginator.sliced_query
# flask.g.user is none when no user is logged - showing builds from everyone
# TODO: builds_logic.BuildsLogic.get_recent_tasks(flask.g.user, 5) takes too much time, optimize sql
# users_builds = builds_logic.BuildsLogic.get_recent_tasks(flask.g.user, 5)
users_builds = builds_logic.BuildsLogic.get_recent_tasks(None, 5)
return flask.render_template("coprs/show/all.html",
coprs=coprs,
paginator=paginator,
tasks_info=ComplexLogic.get_queues_size(),
users_builds=users_builds)
示例3: coprs_fulltext_search
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_queues_size [as 别名]
def coprs_fulltext_search(page=1):
fulltext = flask.request.args.get("fulltext", "")
try:
query = coprs_logic.CoprsLogic.get_multiple_fulltext(fulltext)
except ValueError as e:
flask.flash(str(e), "error")
return flask.redirect(flask.request.referrer or
flask.url_for("coprs_ns.coprs_show"))
paginator = helpers.Paginator(query, query.count(), page,
additional_params={"fulltext": fulltext})
coprs = paginator.sliced_query
return render_template(
"coprs/show/fulltext.html",
coprs=coprs,
paginator=paginator,
fulltext=fulltext,
tasks_info=ComplexLogic.get_queues_size(),
)
示例4: coprs_by_owner
# 需要导入模块: from coprs.logic.complex_logic import ComplexLogic [as 别名]
# 或者: from coprs.logic.complex_logic.ComplexLogic import get_queues_size [as 别名]
def coprs_by_owner(username=None, page=1):
user = users_logic.UsersLogic.get(username).first()
if not user:
return page_not_found(
"User {0} does not exist.".format(username))
query = CoprsLogic.get_multiple_owned_by_username(username)
query = CoprsLogic.filter_without_group_projects(query)
query = CoprsLogic.set_query_order(query, desc=True)
paginator = helpers.Paginator(query, query.count(), page)
coprs = paginator.sliced_query
# flask.g.user is none when no user is logged - showing builds from everyone
users_builds = builds_logic.BuildsLogic.get_recent_tasks(flask.g.user, 5)
return flask.render_template("coprs/show/user.html",
user=user,
coprs=coprs,
paginator=paginator,
tasks_info=ComplexLogic.get_queues_size(),
users_builds=users_builds)