Project

General

Profile

« Previous | Next » 

Revision 2512

db_xml.py: into_table_name(): Handle hierarchical tables specially by including their rank in the into table. Interpret any table with a value column as a function, regardless of out_table name.

View differences:

lib/db_xml.py
130 130

  
131 131
def into_table_name(out_table, row):
132 132
    into = None
133
    if xml_func.is_func_name(out_table):
134
        col_name = sql.clean_name(str(sql_gen.remove_col_rename(row['value'])))
133
    try: in_col = row['value']
134
    except KeyError:
135
        out_col = 'rank'
136
        try: in_col = row[out_col]
137
        except KeyError: pass
138
        else: # has a rank column, so hierarchical
139
            col_name = sql.clean_name(str(sql_gen.remove_col_rename(in_col)))
140
            into = out_table+'['+out_col+'='+col_name+']'
141
    else: # has a value column, so function-like
142
        col_name = sql.clean_name(str(sql_gen.remove_col_rename(in_col)))
135 143
        into = out_table+'('+col_name+')'
136 144
    return into
137 145

  

Also available in: Unified diff