Project

General

Profile

« Previous | Next » 

Revision 2581

db_xml.py: into_table_name(): Removed no longer necessary handling of simple functions, which is now done by sql.into_table_name(). Ensure that rank params in functions (not tables) are not treated specially as hierarchical.

View differences:

lib/db_xml.py
128 128
    
129 129
    def __str__(self): return self.name
130 130

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

  
146 142
input_col_prefix = '$'
......
236 232
    
237 233
    # Insert node
238 234
    pkeys_loc = sql.put_table(db, out_table, in_tables, row, row_ins_ct_ref,
239
        into_table_name(out_table, row), next, is_func)
235
        into_table_name(out_table, row, is_func), next, is_func)
240 236
    if commit: db.db.commit()
241 237
    
242 238
    # Insert children with fkeys to parent

Also available in: Unified diff