本文整理汇总了Python中helpers.push_helper.PushHelper.get_users_subscribed_to_event方法的典型用法代码示例。如果您正苦于以下问题:Python PushHelper.get_users_subscribed_to_event方法的具体用法?Python PushHelper.get_users_subscribed_to_event怎么用?Python PushHelper.get_users_subscribed_to_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.push_helper.PushHelper
的用法示例。
在下文中一共展示了PushHelper.get_users_subscribed_to_event方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_match_video
# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
def send_match_video(cls, match):
"""
Sends match_video and event_match_video notifications
If the match is current, MatchVideoNotification is sent.
Otherwise, EventMatchVideoNotification is sent
"""
match_users = set(PushHelper.get_users_subscribed_to_match(match, NotificationType.MATCH_VIDEO))
event_users = set(PushHelper.get_users_subscribed_to_event(match.event.get(), NotificationType.MATCH_VIDEO))
users = match_users.union(event_users)
if match.within_seconds(60*10):
user_keys = PushHelper.get_client_ids_for_users(users)
MatchVideoNotification(match).send(user_keys)
else:
user_keys = PushHelper.get_client_ids_for_users(users)
EventMatchVideoNotification(match).send(user_keys)
示例2: send_award_update
# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
def send_award_update(cls, event):
users = PushHelper.get_users_subscribed_to_event(event, NotificationType.AWARDS)
keys = PushHelper.get_client_ids_for_users(users)
notification = AwardsUpdatedNotification(event)
notification.send(keys)
示例3: send_schedule_update
# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import get_users_subscribed_to_event [as 别名]
def send_schedule_update(cls, event):
users = PushHelper.get_users_subscribed_to_event(event, NotificationType.SCHEDULE_UPDATED)
keys = PushHelper.get_client_ids_for_users(users)
notification = ScheduleUpdatedNotification(event)
notification.send(keys)