本文整理汇总了Python中helpers.push_helper.PushHelper.notification_string_from_enums方法的典型用法代码示例。如果您正苦于以下问题:Python PushHelper.notification_string_from_enums方法的具体用法?Python PushHelper.notification_string_from_enums怎么用?Python PushHelper.notification_string_from_enums使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.push_helper.PushHelper
的用法示例。
在下文中一共展示了PushHelper.notification_string_from_enums方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list_subscriptions
# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import notification_string_from_enums [as 别名]
def list_subscriptions(self, request):
user_id = get_current_user_id(self.headers)
if user_id is None:
return SubscriptionCollection(subscriptions=[])
subscriptions = Subscription.query(ancestor=ndb.Key(Account, user_id)).fetch()
output = []
for subscription in subscriptions:
output.append(SubscriptionMessage(
model_key=subscription.model_key,
notifications=PushHelper.notification_string_from_enums(subscription.notification_types),
model_type=subscription.model_type))
return SubscriptionCollection(subscriptions=output)
示例2: list_subscriptions
# 需要导入模块: from helpers.push_helper import PushHelper [as 别名]
# 或者: from helpers.push_helper.PushHelper import notification_string_from_enums [as 别名]
def list_subscriptions(self, request):
current_user = endpoints.get_current_user()
if current_user is None:
return SubscriptionCollection(subscriptions=[])
user_id = PushHelper.user_email_to_id(current_user.email())
subscriptions = Subscription.query(ancestor=ndb.Key(Account, user_id)).fetch()
output = []
for subscription in subscriptions:
output.append(SubscriptionMessage(
model_key=subscription.model_key,
notifications=PushHelper.notification_string_from_enums(subscription.notification_types),
model_type=subscription.model_type))
return SubscriptionCollection(subscriptions=output)