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