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


Python FriendshipPrototype.get_candidates_for方法代码示例

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


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

示例1: candidates

# 需要导入模块: from the_tale.accounts.friends.prototypes import FriendshipPrototype [as 别名]
# 或者: from the_tale.accounts.friends.prototypes.FriendshipPrototype import get_candidates_for [as 别名]
 def candidates(self):
     candidates = FriendshipPrototype.get_candidates_for(self.account)
     accounts_ids = [account.id for account in candidates]
     clans_ids = [model.clan_id for model in candidates]
     heroes = {hero.account_id: hero for hero in heroes_logic.load_heroes_by_account_ids(accounts_ids)}
     clans = {clan.id: clan for clan in ClanPrototype.get_list_by_id(clans_ids)}
     return self.template(
         "friends/friends_candidates.html", {"candidates": candidates, "heroes": heroes, "clans": clans}
     )
开发者ID:Tiendil,项目名称:the-tale,代码行数:11,代码来源:views.py

示例2: candidates

# 需要导入模块: from the_tale.accounts.friends.prototypes import FriendshipPrototype [as 别名]
# 或者: from the_tale.accounts.friends.prototypes.FriendshipPrototype import get_candidates_for [as 别名]
 def candidates(self):
     candidates = FriendshipPrototype.get_candidates_for(self.account)
     accounts_ids = [account.id for account in candidates]
     clans_ids = [ model.clan_id for model in candidates]
     heroes = dict( (model.account_id, HeroPrototype(model=model)) for model in Hero.objects.filter(account_id__in=accounts_ids))
     clans = {clan.id:clan for clan in ClanPrototype.get_list_by_id(clans_ids)}
     return self.template('friends/friends_candidates.html',
                          {'candidates': candidates,
                           'heroes': heroes,
                           'clans': clans})
开发者ID:Alkalit,项目名称:the-tale,代码行数:12,代码来源:views.py

示例3: friends

# 需要导入模块: from the_tale.accounts.friends.prototypes import FriendshipPrototype [as 别名]
# 或者: from the_tale.accounts.friends.prototypes.FriendshipPrototype import get_candidates_for [as 别名]
 def friends(self):
     friends = FriendshipPrototype.get_friends_for(self.account)
     candidates = FriendshipPrototype.get_candidates_for(self.account)
     accounts_ids = [account.id for account in friends]
     clans_ids = [ model.clan_id for model in friends]
     heroes = {hero.account_id: hero for hero in  heroes_logic.load_heroes_by_account_ids(accounts_ids)}
     clans = {clan.id:clan for clan in ClanPrototype.get_list_by_id(clans_ids)}
     return self.template('friends/friends_list.html',
                          {'friends': friends,
                           'candidates': candidates,
                           'heroes': heroes,
                           'clans': clans})
开发者ID:Jazzis18,项目名称:the-tale,代码行数:14,代码来源:views.py


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