本文整理匯總了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)
示例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)
示例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)
示例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)