(project, json_data)
return json_data
Fills json information by name.
    Used when filling in demonstration data and not user selection.
Fills json information by name.
    Used when filling in demonstration data and not user selection.
Fills json information by name . Used when filling in demonstration data and not user selection .
def fill_data_by_name(project, json_data):
    """
    Fills json information by name.
    Used when filling in demonstration data and not user selection.
    """

    json_data = copy.deepcopy(json_data)
    # A mapping of data by name

    for field, item in json_data.items():
        # If the field is a data field then fill in more information.
        val = item.get("value", '')
        if item.get("source") == "PROJECT":
            name = item.get("value")

            item['toc'] = "FILE-LIST"
            item['file_list'] = "FILE-LIST"
            item['value'] = name or 'FILENAME'
            item['data_dir'] = "DATA_DIR"
            item['id'] = "DATA_ID"
            item['name'] = "DATA_NAME"
            item['uid'] = "DATA_UID"
            item['project_dir'] = project.get_data_dir()
            item['data_url'] = "/"

            continue

        # Give a placeholder so templates do not have **MISSING**.
        if val is None or len(str(val)) == 0:
            item['value'] = f'{str(field).upper()}'

    return json_data
def fill_data_by_name ( project , json_data ) : json_data = copy . deepcopy ( json_data ) # A mapping of data by name for field , item in json_data . items ( ) : # If the field is a data field then fill in more information. val = item . get ( "value" , '' ) if item . get ( "source" ) == "PROJECT" : name = item . get ( "value" ) item [ 'toc' ] = "FILE-LIST" item [ 'file_list' ] = "FILE-LIST" item [ 'value' ] = name or 'FILENAME' item [ 'data_dir' ] = "DATA_DIR" item [ 'id' ] = "DATA_ID" item [ 'name' ] = "DATA_NAME" item [ 'uid' ] = "DATA_UID" item [ 'project_dir' ] = project . get_data_dir ( ) item [ 'data_url' ] = "/" continue # Give a placeholder so templates do not have **MISSING**. if val is None or len ( str ( val ) ) == 0 : item [ 'value' ] = f'{str(field).upper()}' return json_data