本文整理汇总了Python中mozillians.groups.models.Group.get_non_functional_areas方法的典型用法代码示例。如果您正苦于以下问题:Python Group.get_non_functional_areas方法的具体用法?Python Group.get_non_functional_areas怎么用?Python Group.get_non_functional_areas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozillians.groups.models.Group
的用法示例。
在下文中一共展示了Group.get_non_functional_areas方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index_groups
# 需要导入模块: from mozillians.groups.models import Group [as 别名]
# 或者: from mozillians.groups.models.Group import get_non_functional_areas [as 别名]
def index_groups(request):
"""Lists all public groups (in use) on Mozillians."""
# Omit functional areas, invisible groups, and groups with
# no vouched members
query = Group.get_non_functional_areas(members__is_vouched=True)
template = 'groups/index_groups.html'
return _list_groups(request, template, query)
示例2: index_groups
# 需要导入模块: from mozillians.groups.models import Group [as 别名]
# 或者: from mozillians.groups.models.Group import get_non_functional_areas [as 别名]
def index_groups(request):
"""Lists all public groups (in use) on Mozillians.
Doesn't list functional areas, invisible groups, and groups with
no vouched members
"""
query = Group.get_non_functional_areas()
template = 'groups/index_groups.html'
return _list_groups(request, template, query)
示例3: index_groups
# 需要导入模块: from mozillians.groups.models import Group [as 别名]
# 或者: from mozillians.groups.models.Group import get_non_functional_areas [as 别名]
def index_groups(request):
"""Lists all public groups (in use) on Mozillians.
Doesn't list functional areas, invisible groups, and groups with
no vouched members
"""
group_form = forms.CreateGroupForm(request.POST or None)
if group_form.is_valid():
group = group_form.save()
group.curators.add(request.user.userprofile)
return redirect(reverse('groups:group_edit', args=[group.url]))
query = Group.get_non_functional_areas()
template = 'groups/index_groups.html'
context = {
'group_form': group_form
}
return _list_groups(request, template, query, context)
示例4: test_get_non_functional_areas
# 需要导入模块: from mozillians.groups.models import Group [as 别名]
# 或者: from mozillians.groups.models.Group import get_non_functional_areas [as 别名]
def test_get_non_functional_areas(self):
UserFactory.create()
UserFactory.create()
GroupFactory.create(functional_area=True)
cgroup_2 = GroupFactory.create(functional_area=False)
eq_(set(Group.get_non_functional_areas()), set([cgroup_2]))