本文整理匯總了Python中h.notification.models.Subscriptions.get_subscriptions_for_uri方法的典型用法代碼示例。如果您正苦於以下問題:Python Subscriptions.get_subscriptions_for_uri方法的具體用法?Python Subscriptions.get_subscriptions_for_uri怎麽用?Python Subscriptions.get_subscriptions_for_uri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類h.notification.models.Subscriptions
的用法示例。
在下文中一共展示了Subscriptions.get_subscriptions_for_uri方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: profile
# 需要導入模塊: from h.notification.models import Subscriptions [as 別名]
# 或者: from h.notification.models.Subscriptions import get_subscriptions_for_uri [as 別名]
def profile(self):
request = self.request
user_id = request.authenticated_userid
subscriptions = Subscriptions.get_subscriptions_for_uri(
request,
user_id
)
return {'model': {'subscriptions': subscriptions}}
示例2: profile
# 需要導入模塊: from h.notification.models import Subscriptions [as 別名]
# 或者: from h.notification.models.Subscriptions import get_subscriptions_for_uri [as 別名]
def profile(self):
request = self.request
model = {}
userid = request.authenticated_userid
if request.registry.feature('notification'):
model['subscriptions'] = Subscriptions.get_subscriptions_for_uri(
request,
userid
)
return {'model': model}
示例3: profile
# 需要導入模塊: from h.notification.models import Subscriptions [as 別名]
# 或者: from h.notification.models.Subscriptions import get_subscriptions_for_uri [as 別名]
def profile(self):
request = self.request
userid = request.authenticated_userid
model = {}
if userid:
model["email"] = self.User.get_by_id(request, userid).email
if request.registry.feature('notification'):
model['subscriptions'] = Subscriptions.get_subscriptions_for_uri(
request,
userid
)
return {'model': model}
示例4: profile
# 需要導入模塊: from h.notification.models import Subscriptions [as 別名]
# 或者: from h.notification.models.Subscriptions import get_subscriptions_for_uri [as 別名]
def profile(self):
"""
Return a serialisation of the user's profile.
For use by the frontend. Includes current email and subscriptions data.
"""
request = self.request
userid = request.authenticated_userid
model = {}
if userid:
model["email"] = User.get_by_id(request, userid).email
if request.feature("notification"):
model["subscriptions"] = Subscriptions.get_subscriptions_for_uri(userid)
return {"model": model}