Project

General

Profile

« Previous | Next » 

Revision 2157

sql.py: mk_select(): fields: Support columns with tables. Changed syntax for literal values so that it wouldn't conflict with new syntax for columns with tables.

View differences:

db_xml.py
156 156
        else:
157 157
            child_value = xml_dom.value_node(child)
158 158
            if is_ptr(child_name) or xml_func.is_func(child_value):
159
                table, col = put_table_(child_value)
160
                row[child_name] = '$'+col
161
                in_tables.append(table)
159
                row[child_name] = put_table_(child_value)
162 160
            else: children.append(child)
163 161
    try: del row[pkey(out_table)]
164 162
    except KeyError: pass
165 163
    
166 164
    # Divide fields into input columns and literal values
167 165
    for out_col, value in row.iteritems():
168
        in_col = strings.remove_prefix('$', value)
169
        if in_col != value: row[out_col] = in_col # value is input column
170
        else: row[out_col] = (value, out_col) # value is literal value
166
        if isinstance(value, tuple): in_tables.append(value[0])
167
        else:
168
            in_col = strings.remove_prefix('$', value)
169
            if in_col != value: row[out_col] = in_col # value is input column
170
            else: row[out_col] = (value,) # value is literal value
171 171
    
172 172
    # Insert node
173 173
    pkeys_loc = sql.put_table(db, esc_name(out_table), in_tables, row,

Also available in: Unified diff