Project

General

Profile

« Previous | Next » 

Revision 468

sql.py: ExceptionWithColumn now stores multiple columns so that they can all be used in DuplicateKeyExceptions

View differences:

db_xml.py
101 101
                if store_ids: xml_dom.set_id(node, id_)
102 102
                break
103 103
            except sql.NullValueException, e:
104
                col = e.cols[0]
104 105
                if try_num > 0: raise # exception still raised after retry
105
                if store_ids and is_ptr(e.col):
106
                if store_ids and is_ptr(col):
106 107
                    # Search for required column in ancestors and their children
107
                    target = find_by_name(node, ptr_type_guess(e.col))
108
                    target = find_by_name(node, ptr_type_guess(col))
108 109
                    if target == None: raise
109
                    row[e.col] = xml_dom.get_id(target)
110
                    row[col] = xml_dom.get_id(target)
110 111
                else: raise
111 112
    except sql.DatabaseErrors, e: on_error_(e); return None
112 113
    

Also available in: Unified diff