(app, case_type)
return paths
Get unique case relationships used by search details in any modules that
    match the given case type and are configured for case search.

    Returns a set of relationships, e.g. {"parent", "host", "parent/parent"}
Get unique case relationships used by search details in any modules that
    match the given case type and are configured for case search.
Get unique case relationships used by search details in any modules that match the given case type and are configured for case search .
def get_related_case_relationships(app, case_type):
    """
    Get unique case relationships used by search details in any modules that
    match the given case type and are configured for case search.

    Returns a set of relationships, e.g. {"parent", "host", "parent/parent"}
    """
    paths = set()
    for module in app.get_modules():
        if module.case_type == case_type and module_offers_search(module):
            for column in module.search_detail("short").columns + module.search_detail("long").columns:
                if not column.useXpathExpression:
                    parts = column.field.split("/")
                    if len(parts) > 1:
                        parts.pop()     # keep only the relationship: "parent", "parent/parent", etc.
                        paths.add("/".join(parts))
    return paths
def get_related_case_relationships ( app , case_type ) : paths = set ( ) for module in app . get_modules ( ) : if module . case_type == case_type and module_offers_search ( module ) : for column in module . search_detail ( "short" ) . columns + module . search_detail ( "long" ) . columns : if not column . useXpathExpression : parts = column . field . split ( "/" ) if len ( parts ) > 1 : parts . pop ( ) # keep only the relationship: "parent", "parent/parent", etc. paths . add ( "/" . join ( parts ) ) return paths