本文整理匯總了Python中edge.Edge._get_edges_with_dst方法的典型用法代碼示例。如果您正苦於以下問題:Python Edge._get_edges_with_dst方法的具體用法?Python Edge._get_edges_with_dst怎麽用?Python Edge._get_edges_with_dst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edge.Edge
的用法示例。
在下文中一共展示了Edge._get_edges_with_dst方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _get_link_details
# 需要導入模塊: from edge import Edge [as 別名]
# 或者: from edge.Edge import _get_edges_with_dst [as 別名]
def _get_link_details(entity, link_name):
""""Lookup the (edge_class, left_edge_id, right_edge_id, node_class)
for the given entity and link_name.
param entity: The current entity Node subclass
:param str link_name: The association proxy name
edge_class: The Edge subclass the association is proxied through
left_edge_id: The edge.{src,dst}_id
right_edge_id: The edge.{dst,src}_id (opposit of left_edge_id)
node_class: The target node the association_proxy points to
"""
# Look for the link_name in OUTBOUND edges from the current
# entity
for edge in Edge._get_edges_with_src(entity.__name__):
if edge.__src_dst_assoc__ == link_name:
return (edge, edge.src_id, edge.dst_id,
Node.get_subclass_named(edge.__dst_class__))
# Look for the link_name in INBOUND edges from the current
# entity
for edge in Edge._get_edges_with_dst(entity.__name__):
if edge.__dst_src_assoc__ == link_name:
return (edge, edge.dst_id, edge.src_id,
Node.get_subclass_named(edge.__src_class__))
raise AttributeError(
"type object '{}' has no attribute '{}'"
.format(entity.__name__, link_name))