本文整理汇总了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)