本文整理汇总了Python中opengever.ogds.base.actor.Actor.inbox方法的典型用法代码示例。如果您正苦于以下问题:Python Actor.inbox方法的具体用法?Python Actor.inbox怎么用?Python Actor.inbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opengever.ogds.base.actor.Actor
的用法示例。
在下文中一共展示了Actor.inbox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_users
# 需要导入模块: from opengever.ogds.base.actor import Actor [as 别名]
# 或者: from opengever.ogds.base.actor.Actor import inbox [as 别名]
def _get_users(self):
items = []
hidden_terms = []
# users
for user in ogds_service().all_users():
if not user.active:
hidden_terms.append(user.userid)
items.append((user.userid, user.label()))
# inboxes
for unit in ogds_service().all_org_units():
items.append((
unit.inbox().id(),
Actor.inbox(unit.inbox().id(), unit).get_label()))
return (items, hidden_terms)
示例2: key_value_provider
# 需要导入模块: from opengever.ogds.base.actor import Actor [as 别名]
# 或者: from opengever.ogds.base.actor.Actor import inbox [as 别名]
def key_value_provider(self):
# Reset hidden_terms every time cache key changed
self.hidden_terms = []
for unit in ogds_service().all_org_units():
for user in unit.assigned_users():
yield (u'{}:{}'.format(unit.id(), user.userid),
unit.prefix_label(user.label()))
# add the inactive users to the vocabulary
# and mark them as hidden terms
for user in ogds_service().inactive_users():
if user.userid not in self.hidden_terms:
self.hidden_terms.append(user.userid)
yield (user.userid, user.label())
# client inbox
inbox_actor = Actor.inbox(unit.inbox().id(), unit)
yield (u'{}:{}'.format(unit.id(), unit.inbox().id()),
inbox_actor.get_label())