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


Python SubmitterDataGrid.render_to_response方法代码示例

本文整理汇总了Python中reviewboard.reviews.datagrids.SubmitterDataGrid.render_to_response方法的典型用法代码示例。如果您正苦于以下问题:Python SubmitterDataGrid.render_to_response方法的具体用法?Python SubmitterDataGrid.render_to_response怎么用?Python SubmitterDataGrid.render_to_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reviewboard.reviews.datagrids.SubmitterDataGrid的用法示例。


在下文中一共展示了SubmitterDataGrid.render_to_response方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: group_members

# 需要导入模块: from reviewboard.reviews.datagrids import SubmitterDataGrid [as 别名]
# 或者: from reviewboard.reviews.datagrids.SubmitterDataGrid import render_to_response [as 别名]
def group_members(request,
                  name,
                  template_name='reviews/datagrid.html',
                  local_site_name=None):
    """
    A list of users registered for a particular group.
    """
    if local_site_name:
        local_site = get_object_or_404(LocalSite, name=local_site_name)
        if not local_site.is_accessible_by(request.user):
            return _render_permission_denied(request)
    else:
        local_site = None

    # Make sure the group exists
    group = get_object_or_404(Group,
                              name=name,
                              local_site=local_site)

    if not group.is_accessible_by(request.user):
        return _render_permission_denied(
            request, 'reviews/group_permission_denied.html')

    datagrid = SubmitterDataGrid(request,
                                 group.users.filter(is_active=True),
                                 _("Members of group %s") % name)

    return datagrid.render_to_response(template_name)
开发者ID:Terhands,项目名称:reviewboard,代码行数:30,代码来源:views.py

示例2: submitter_list

# 需要导入模块: from reviewboard.reviews.datagrids import SubmitterDataGrid [as 别名]
# 或者: from reviewboard.reviews.datagrids.SubmitterDataGrid import render_to_response [as 别名]
def submitter_list(request,
                   local_site_name=None,
                   template_name='reviews/datagrid.html'):
    """
    Displays a list of all users.
    """
    grid = SubmitterDataGrid(
        request, local_site=get_object_or_none(LocalSite, name=local_site_name))
    return grid.render_to_response(template_name)
开发者ID:yang,项目名称:reviewboard,代码行数:11,代码来源:views.py

示例3: group_members

# 需要导入模块: from reviewboard.reviews.datagrids import SubmitterDataGrid [as 别名]
# 或者: from reviewboard.reviews.datagrids.SubmitterDataGrid import render_to_response [as 别名]
def group_members(request, name, template_name="reviews/datagrid.html"):
    """
    A list of users registered for a particular group.
    """
    # Make sure the group exists
    get_object_or_404(Group, name=name)

    datagrid = SubmitterDataGrid(
        request, Group.objects.get(name=name).users.filter(is_active=True), _("Members of group %s") % name
    )

    return datagrid.render_to_response(template_name)
开发者ID:mrhiccup,项目名称:reviewboard,代码行数:14,代码来源:views.py

示例4: submitter_list

# 需要导入模块: from reviewboard.reviews.datagrids import SubmitterDataGrid [as 别名]
# 或者: from reviewboard.reviews.datagrids.SubmitterDataGrid import render_to_response [as 别名]
def submitter_list(request, local_site_name=None, template_name="reviews/datagrid.html"):
    """
    Displays a list of all users.
    """
    if local_site_name:
        local_site = get_object_or_404(LocalSite, name=local_site_name)
        if not local_site.is_accessible_by(request.user):
            return _render_permission_denied(request)
    else:
        local_site = None
    grid = SubmitterDataGrid(request, local_site=local_site)
    return grid.render_to_response(template_name)
开发者ID:georgemarshall,项目名称:reviewboard,代码行数:14,代码来源:views.py


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