本文整理汇总了Python中helpers.firebase.firebase_pusher.FirebasePusher.update_event_details方法的典型用法代码示例。如果您正苦于以下问题:Python FirebasePusher.update_event_details方法的具体用法?Python FirebasePusher.update_event_details怎么用?Python FirebasePusher.update_event_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.firebase.firebase_pusher.FirebasePusher
的用法示例。
在下文中一共展示了FirebasePusher.update_event_details方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: postUpdateHook
# 需要导入模块: from helpers.firebase.firebase_pusher import FirebasePusher [as 别名]
# 或者: from helpers.firebase.firebase_pusher.FirebasePusher import update_event_details [as 别名]
def postUpdateHook(cls, event_details_list, updated_attr_list, is_new_list):
"""
To run after models have been updated
"""
for (event_details, updated_attrs) in zip(event_details_list, updated_attr_list):
event = Event.get_by_id(event_details.key.id())
try:
if event.within_a_day and "alliance_selections" in updated_attrs:
# Send updated alliances notification
logging.info("Sending alliance notifications for {}".format(event.key_name))
NotificationHelper.send_alliance_update(event)
except Exception:
logging.error("Error sending alliance update notification for {}".format(event.key_name))
logging.error(traceback.format_exc())
# Enqueue task to calculate district points
try:
taskqueue.add(
url='/tasks/math/do/district_points_calc/{}'.format(event.key.id()),
method='GET')
except Exception:
logging.error("Error enqueuing district_points_calc for {}".format(event.key.id()))
logging.error(traceback.format_exc())
# Enqueue task to calculate event team status
try:
taskqueue.add(
url='/tasks/math/do/event_team_status/{}'.format(event.key.id()),
method='GET')
except Exception:
logging.error("Error enqueuing event_team_status for {}".format(event.key.id()))
logging.error(traceback.format_exc())
try:
FirebasePusher.update_event_details(event_details)
except Exception:
logging.warning("Firebase update_event_details failed!")