(schema)
return dr_sources
Returns a dict of names for sources of data_relations:

    e.g. the name field in the user resource relates to (is a copy of) the
    name field of the person resource
    => return {'person_name': None}
Returns a dict of names for sources of data_relations:
Returns a dict of names for sources of data_relations :
def _get_dr_sources(schema):
    """
    Returns a dict of names for sources of data_relations:

    e.g. the name field in the user resource relates to (is a copy of) the
    name field of the person resource
    => return {'person_name': None}
    """
    dr_sources = {}
    for rules in schema.values():
        if "data_relation" in rules:
            dr = rules["data_relation"]
            if dr["resource"] not in app.config["DOMAIN"]:
                # source of data_relation does not exist
                continue
            title = app.config["DOMAIN"][dr["resource"]]["item_title"]
            def_name = title + "_" + dr["field"]
            dr_sources[def_name] = None
        elif "schema" in rules:
            if rules.get("type") in "dict":
                # recursively handle data_relations in subdicts
                dr_sources.update(_get_dr_sources(rules["schema"]))
            elif rules.get("type") == "list" and "schema" in rules["schema"]:
                # recursively handle data_relations in lists
                dr_sources.update(_get_dr_sources(rules["schema"]["schema"]))
    return dr_sources
def _get_dr_sources ( schema ) : dr_sources = { } for rules in schema . values ( ) : if "data_relation" in rules : dr = rules [ "data_relation" ] if dr [ "resource" ] not in app . config [ "DOMAIN" ] : # source of data_relation does not exist continue title = app . config [ "DOMAIN" ] [ dr [ "resource" ] ] [ "item_title" ] def_name = title + "_" + dr [ "field" ] dr_sources [ def_name ] = None elif "schema" in rules : if rules . get ( "type" ) in "dict" : # recursively handle data_relations in subdicts dr_sources . update ( _get_dr_sources ( rules [ "schema" ] ) ) elif rules . get ( "type" ) == "list" and "schema" in rules [ "schema" ] : # recursively handle data_relations in lists dr_sources . update ( _get_dr_sources ( rules [ "schema" ] [ "schema" ] ) ) return dr_sources