本文整理汇总了Python中pyon.public.IonObject.org_id方法的典型用法代码示例。如果您正苦于以下问题:Python IonObject.org_id方法的具体用法?Python IonObject.org_id怎么用?Python IonObject.org_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.public.IonObject
的用法示例。
在下文中一共展示了IonObject.org_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _convert_negotiations_to_requests
# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import org_id [as 别名]
def _convert_negotiations_to_requests(self, negotiations=None, user_info_id='', org_id=''):
assert isinstance(negotiations, list)
orgs,_ = self.clients.resource_registry.find_resources(restype=RT.Org)
ret_list = []
for neg in negotiations:
request = IonObject(OT.OrgUserNegotiationRequest, ts_updated=neg.ts_updated, negotiation_id=neg._id,
negotiation_type=NegotiationTypeEnum._str_map[neg.negotiation_type],
negotiation_status=NegotiationStatusEnum._str_map[neg.negotiation_status],
originator=ProposalOriginatorEnum._str_map[neg.proposals[-1].originator],
request_type=neg.proposals[-1].type_,
description=neg.description, reason=neg.reason,
user_id=user_info_id)
# since this is a proxy for the Negotiation object, simulate its id to help the UI deal with it
request._id = neg._id
org_request = [ o for o in orgs if o._id == neg.proposals[-1].provider ]
if org_request:
request.org_id = org_request[0]._id
request.name = org_request[0].name
ret_list.append(request)
return ret_list