Revision 6410
Added by Aaron Marcuse-Kubitza about 12 years ago
db_xml.py | ||
---|---|---|
56 | 56 |
|
57 | 57 |
no_parent_ids_loc = object() # tells put() there is no parent_ids_loc |
58 | 58 |
|
59 |
def put(db, node, row_ins_ct_ref=None, on_error=exc.reraise, col_defaults={},
|
|
59 |
def put(db, node, row_ins_ct_ref=None, on_error=exc.reraise, col_defaults=None,
|
|
60 | 60 |
in_table=None, parent_ids_loc=no_parent_ids_loc, next=None): |
61 | 61 |
''' |
62 | 62 |
@param node To use an entire XML document, pass root.firstChild. |
... | ... | |
64 | 64 |
if node == None: return None # when no rows, root.firstChild == None |
65 | 65 |
elif xml_dom.is_text_node(node): return xml_dom.value(node) |
66 | 66 |
|
67 |
if col_defaults == None: col_defaults = {} |
|
68 |
|
|
67 | 69 |
def put_(node): |
68 | 70 |
if util.is_str(node): return node |
69 | 71 |
return put(db, node, row_ins_ct_ref, on_error, col_defaults, in_table, |
Also available in: Unified diff
db_xml.py: put(): col_defaults param: Fixed bug where need to use None as default value, because col_defaults will be modified by put() and the {} default value is a global instance