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


Python GsuserManager.list_userprofile_by_ids方法代码示例

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


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

示例1: list_feed_by_ids

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import list_userprofile_by_ids [as 别名]
 def list_feed_by_ids(self, ids):
     feeds = get_many(Feed, ids)
     user_ids = Set([x.user_id for x in feeds])
     userprofile_dict = dict((x.id, x) for x in GsuserManager.list_userprofile_by_ids(user_ids))
     for feed in feeds:
         if feed.user_id in userprofile_dict:
             feed.userprofile = userprofile_dict[feed.user_id]
     return feeds
开发者ID:ZheYuan,项目名称:gitshell,代码行数:10,代码来源:models.py

示例2: list_groupMember_by_teamGroupId

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import list_userprofile_by_ids [as 别名]
 def list_groupMember_by_teamGroupId(self, group_id):
     groupMembers = query(GroupMember, group_id, 'groupmember_l_groupId', [group_id])
     user_ids = [x.member_user_id for x in groupMembers]
     userprofiles = GsuserManager.list_userprofile_by_ids(user_ids)
     userprofile_dict = dict((x.id, x)for x in userprofiles)
     for x in groupMembers:
         if x.member_user_id in userprofile_dict:
             x.member_userprofile = userprofile_dict[x.member_user_id]
     return groupMembers
开发者ID:ZheYuan,项目名称:gitshell,代码行数:11,代码来源:models.py

示例3: list_repo_team_memberUser

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import list_userprofile_by_ids [as 别名]
 def list_repo_team_memberUser(self, repo_id):
     repo = self.get_repo_by_id(repo_id)
     if not repo:
         return []
     repoemembers = self.list_repomember(repo_id)
     user_ids = [x.user_id for x in repoemembers]
     userprofile = GsuserManager.get_userprofile_by_id(repo.user_id)
     if not userprofile:
         return []
     if userprofile.is_team_account == 0:
         user_ids.insert(0, repo.user_id)
     if userprofile.is_team_account == 1:
         teamMembers = TeamManager.list_teamMember_by_teamUserId(userprofile.id)
         for x in teamMembers:
             if x.user_id not in user_ids:
                 user_ids.append(x.user_id)
     return GsuserManager.list_userprofile_by_ids(user_ids)
开发者ID:ZheYuan,项目名称:gitshell,代码行数:19,代码来源:models.py

示例4: _fillwith_notifMessages

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import list_userprofile_by_ids [as 别名]
    def _fillwith_notifMessages(self, notifMessages):
        repo_ids = [x.repo_id for x in notifMessages]
        userprofile_ids = [x.user_id for x in notifMessages]
        repo_dict = dict((x.id, x) for x in RepoManager.list_repo_by_ids(repo_ids))
        userprofile_dict = dict((x.id, x) for x in GsuserManager.list_userprofile_by_ids(userprofile_ids))
        for notifMessage in notifMessages:
            if notifMessage.repo_id in repo_dict:
                notifMessage.repo = repo_dict[notifMessage.repo_id]
            if notifMessage.from_user_id in userprofile_dict:
                notifMessage.from_userprofile = userprofile_dict[notifMessage.from_user_id]

            if notifMessage.is_at_commit():
                commitHistory = RepoManager.get_commit_by_id(notifMessage.relative_id)
                notifMessage.relative_obj = commitHistory
            elif notifMessage.is_at_issue() or notifMessage.is_issue_cate():
                issue = IssueManager.get_issue_by_id(notifMessage.relative_id)
                notifMessage.relative_obj = issue
            elif notifMessage.is_at_merge() or notifMessage.is_pull_request_cate():
                pullRequest = RepoManager.get_pullRequest_by_id(notifMessage.relative_id)
                notifMessage.relative_obj = pullRequest
            elif notifMessage.is_at_issue_comment():
                issue_comment = IssueManager.get_issue_comment(notifMessage.relative_id)
                notifMessage.relative_obj = issue_comment
        return notifMessages
开发者ID:ZheYuan,项目名称:gitshell,代码行数:26,代码来源:models.py


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