当前位置: 首页>>代码示例>>Python>>正文


Python ComplexLogic.get_queues_size方法代码示例

本文整理汇总了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
    )
开发者ID:evilkost,项目名称:copr,代码行数:18,代码来源:groups_general.py

示例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)
开发者ID:ignatenkobrain,项目名称:copr,代码行数:20,代码来源:coprs_general.py

示例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(),
    )
开发者ID:ignatenkobrain,项目名称:copr,代码行数:22,代码来源:coprs_general.py

示例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)
开发者ID:ignatenkobrain,项目名称:copr,代码行数:25,代码来源:coprs_general.py


注:本文中的coprs.logic.complex_logic.ComplexLogic.get_queues_size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。