當前位置: 首頁>>代碼示例>>Python>>正文


Python datagrids.SubmitterDataGrid類代碼示例

本文整理匯總了Python中reviewboard.reviews.datagrids.SubmitterDataGrid的典型用法代碼示例。如果您正苦於以下問題:Python SubmitterDataGrid類的具體用法?Python SubmitterDataGrid怎麽用?Python SubmitterDataGrid使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SubmitterDataGrid類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: group_members

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,代碼行數:28,代碼來源:views.py

示例2: submitter_list

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,代碼行數:9,代碼來源:views.py

示例3: group_members

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,代碼行數:12,代碼來源:views.py

示例4: submitter_list

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,代碼行數:12,代碼來源:views.py


注:本文中的reviewboard.reviews.datagrids.SubmitterDataGrid類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。