(src, relationship_type, object_id, target=True)
return remove_deprecated(results)
Filters data source by type, relationship_type and source or target
Filters data source by type, relationship_type and source or target
Filters data source by type relationship_type and source or target
def filter_for_term_relationships(src, relationship_type, object_id, target=True):
    """Filters data source by type, relationship_type and source or target"""
    filters = [
        Filter("type", "=", "relationship"),
        Filter("relationship_type", "=", relationship_type),
    ]
    if target:
        filters.append(Filter("target_ref", "=", object_id))
    else:
        filters.append(Filter("source_ref", "=", object_id))

    results = src.query(filters)
    return remove_deprecated(results)
def filter_for_term_relationships ( src , relationship_type , object_id , target = True ) : filters = [ Filter ( "type" , "=" , "relationship" ) , Filter ( "relationship_type" , "=" , relationship_type ) , ] if target : filters . append ( Filter ( "target_ref" , "=" , object_id ) ) else : filters . append ( Filter ( "source_ref" , "=" , object_id ) ) results = src . query ( filters ) return remove_deprecated ( results )