Project

General

Profile

« Previous | Next » 

Revision 463

db_xml.py: Map empty fields to None instead of ignoring them, to ensure that an existing row with a value in that field is not used in the duplicate elimination

View differences:

lib/db_xml.py
79 79
    # Divide children into fields and children with fkeys to parent
80 80
    for child in xml_dom.NodeElemIter(node):
81 81
        child_name = name_of(child)
82
        if xml_dom.is_empty(child): pass # ignore empty field
82
        if xml_dom.is_empty(child): row[child_name] = None
83 83
        elif xml_dom.is_text(child):
84 84
            row[child_name] = strings.to_unicode(xml_dom.value(child))
85 85
        elif is_ptr(child_name): row[child_name] = put_(ptr_target(child))

Also available in: Unified diff