Project

General

Profile

« Previous | Next » 

Revision 2491

db_xml.py: put_table(): sql.put_table(): Name the into table ...literal instead of ...value if the value column is a literal value

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):
132
    into = None
133
    if xml_func.is_func_name(out_table):
134
        into = out_table+'_'
135
        value_col = row['value']
136
        if isinstance(value_col, sql_gen.NamedCol): into += 'literal'
137
        else: into += value_col.name
138
    return into
139

  
131 140
input_col_prefix = '$'
132 141

  
133 142
def put_table(db, node, in_table, commit=False, in_row_ct_ref=None,
......
218 227
            row[out_col] = sql_gen.NamedCol(out_col, value)
219 228
    
220 229
    # Insert node
221
    into = None
222
    if xml_func.is_func_name(out_table): into = out_table+'_'+row['value'].name
223 230
    pkeys_loc = sql.put_table(db, out_table, in_tables, row, row_ins_ct_ref,
224
        into)
231
        into_table_name(out_table, row))
225 232
    if commit: db.db.commit()
226 233
    
227 234
    # Insert children with fkeys to parent

Also available in: Unified diff