當前位置: 首頁>>代碼示例>>Python>>正文


Python Edge._get_edges_with_dst方法代碼示例

本文整理匯總了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))
開發者ID:NCI-GDC,項目名稱:psqlgraph,代碼行數:33,代碼來源:query.py


注:本文中的edge.Edge._get_edges_with_dst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。