当前位置: 首页>>代码示例>>Python>>正文


Python Team.get_by_domain方法代码示例

本文整理汇总了Python中corehq.apps.orgs.models.Team.get_by_domain方法的典型用法代码示例。如果您正苦于以下问题:Python Team.get_by_domain方法的具体用法?Python Team.get_by_domain怎么用?Python Team.get_by_domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在corehq.apps.orgs.models.Team的用法示例。


在下文中一共展示了Team.get_by_domain方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: apply_teams_to_users

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
 def apply_teams_to_users(self, web_users):
     teams = Team.get_by_domain(self.domain)
     for team in teams:
         for user in team.get_members():
             if user.get_id not in [web_user.get_id for web_user in web_users]:
                 user.from_team = True
                 web_users.append(user)
     for user in web_users:
         user.current_domain = self.domain
开发者ID:LifeCoaching,项目名称:commcare-hq,代码行数:11,代码来源:__init__.py

示例2: web_users

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
 def web_users(self):
     web_users = WebUser.by_domain(self.domain)
     teams = Team.get_by_domain(self.domain)
     for team in teams:
         for user in team.get_members():
             if user.get_id not in [web_user.get_id for web_user in web_users]:
                 user.from_team = True
                 web_users.append(user)
     for user in web_users:
         user.current_domain = self.domain
     return web_users
开发者ID:pawelreise,项目名称:commcare-hq,代码行数:13,代码来源:__init__.py

示例3: web_users

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
 def web_users(self):
     web_users = WebUser.by_domain(self.domain)
     teams = Team.get_by_domain(self.domain)
     for team in teams:
         for user in team.get_members():
             if user.get_id not in [web_user.get_id for web_user in web_users]:
                 user.from_team = True
                 web_users.append(user)
     for user in web_users:
         user.current_domain = self.domain
     web_users.sort(key=lambda x: (x.role_label(), x.email))
     return web_users
开发者ID:bradmerlin,项目名称:commcare-hq,代码行数:14,代码来源:__init__.py

示例4: _users_context

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
def _users_context(request, domain):
    couch_user = request.couch_user
    web_users = WebUser.by_domain(domain)
    teams = Team.get_by_domain(domain)
    for team in teams:
        for member_id in team.member_ids:
            team_user = WebUser.get(member_id)
            if team_user.get_id not in [web_user.get_id for web_user in web_users]:
                    web_users.append(team_user)

    for user in [couch_user] + list(web_users):
        user.current_domain = domain

    return {
        'web_users': web_users,
        'domain': domain,
        'couch_user': couch_user,
    }
开发者ID:mchampanis,项目名称:core-hq,代码行数:20,代码来源:views.py

示例5: org_settings

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
def org_settings(request, domain):
    domain = Domain.get_by_name(domain)

    org_users = []
    teams = Team.get_by_domain(domain.name)
    for team in teams:
        for user in team.get_members():
            user.team_id = team.get_id
            user.team = team.name
            org_users.append(user)

    for user in org_users:
        user.current_domain = domain.name

    return render(request, 'domain/orgs_settings.html', {
        "project": domain, 'domain': domain.name,
        "organization": Organization.get_by_name(getattr(domain, "organization", None)),
        "org_users": org_users
    })
开发者ID:birdsarah,项目名称:core-hq,代码行数:21,代码来源:views.py

示例6: page_context

# 需要导入模块: from corehq.apps.orgs.models import Team [as 别名]
# 或者: from corehq.apps.orgs.models.Team import get_by_domain [as 别名]
    def page_context(self):
        domain = self.domain_object
        org_users = []
        teams = Team.get_by_domain(domain.name)
        for team in teams:
            for user in team.get_members():
                user.team_id = team.get_id
                user.team = team.name
                org_users.append(user)

        for user in org_users:
            user.current_domain = domain.name

        all_orgs = Organization.get_all()

        return {
            "project": domain,
            'domain': domain.name,
            "organization": Organization.get_by_name(getattr(domain, "organization", None)),
            "org_users": org_users,
            "all_orgs": all_orgs,
        }
开发者ID:shashanks,项目名称:commcare-hq,代码行数:24,代码来源:views.py


注:本文中的corehq.apps.orgs.models.Team.get_by_domain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。