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


Python User.all_users方法代码示例

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


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

示例1: broadcast_info

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def broadcast_info(cls, title, message):
     ''' Send a info notification to all users '''
     event_uuid = unicode(uuid4())
     cls.__anonymous__(title, message, INFO, event_uuid)
     for user in User.all_users():
         cls.__create__(user, title, message, INFO, event_uuid)
     return event_uuid
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:9,代码来源:Notifier.py

示例2: broadcast_success

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def broadcast_success(cls, title, message):
     ''' Send a success notification to all users '''
     event_uuid = unicode(uuid4())
     cls.__anonymous__(title, message, SUCCESS, event_uuid)
     for user in User.all_users():
         cls.__create__(user, title, message, SUCCESS, event_uuid)
     return event_uuid
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:9,代码来源:Notifier.py

示例3: broadcast_custom

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def broadcast_custom(cls, title, message, icon):
     ''' Send a custom notification to all users '''
     event_uuid = unicode(uuid4())
     cls.__anonymous__(title, message, CUSTOM, event_uuid, icon)
     for user in User.all_users():
         cls.__create__(user, title, message, CUSTOM, event_uuid, icon)
     return event_uuid
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:9,代码来源:Notifier.py

示例4: broadcast_warning

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def broadcast_warning(cls, title, message):
     ''' Send a warning notification to all users '''
     event_uuid = unicode(uuid4())
     cls.__anonymous__(title, message, WARNING, event_uuid)
     for user in User.all_users():
         cls.__create__(user, title, message, WARNING, event_uuid)
     return event_uuid
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:9,代码来源:Notifier.py

示例5: create_broadcast

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def create_broadcast(cls, team, title, message, icon=None):
     if not options.global_notification and team:
         cls.create_team(team, title, message, icon)
     else:
         for user in User.all_users():
             notification = cls._create(user, title, message, icon)
             dbsession.add(notification)
         dbsession.commit()
开发者ID:moloch--,项目名称:RootTheBox,代码行数:10,代码来源:Notification.py

示例6: render_page

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def render_page(self, errors=None):
     ''' Render page with extra arguments '''
     if errors is not None and not isinstance(errors, list):
         errors = [str(errors), ]
     user = self.get_current_user()
     targets = filter(
         lambda target: target not in user.team.members, User.all_users())
     self.render('upgrades/swat.html',
                 targets=targets,
                 user_bribes=Swat.ordered_by_user_id(user.id),
                 errors=None)
开发者ID:moloch--,项目名称:RootTheBox,代码行数:13,代码来源:UpgradeHandlers.py

示例7: leaderboard

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def leaderboard(cls, order_by='passwords'):
     '''
     Creates an ordered list of tuples, for each user and the
     number of password they've cracked
     '''
     orders = {'passwords': 1, 'cash': 2}
     leaders = []
     for user in User.all_users():
         if 0 < cls.count_cracked_by(user.id):
             leaders.append((user,
                 cls.count_cracked_by(user.id),
                 sum(cls.by_cracker_id(user.id)),
             ))
     if order_by not in orders: order_by = 'passwords'
     leaders.sort(key=lambda stats: stats[orders[order_by]], reverse=True)
     return leaders
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:18,代码来源:WallOfSheep.py

示例8: create_broadcast

# 需要导入模块: from models.User import User [as 别名]
# 或者: from models.User.User import all_users [as 别名]
 def create_broadcast(cls, title, message, icon=None):
     for user in User.all_users():
         notification = cls._create(user, title, message, icon)
         dbsession.add(notification)
     dbsession.commit()
开发者ID:AnarKyx01,项目名称:RootTheBox,代码行数:7,代码来源:Notification.py


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