Fixed problem with metadata extensions
With this small modification, I fixed I problem I was experiencing while trying to add RequestInitiator extension to a SP metadata. The problem here is that the XML attributes are called Binding and Location while the python instance attributes are called binding and location respectively. Se the instruction "elif key in _inst.c_attributes:" needs to have key with the capital letter while the setattr needs the lowercase name of the field. To be more generic I imagined it was better to retrieve the field name from the tuple associated to the field in c_attributes.
This commit is contained in:
@@ -469,7 +469,7 @@ def rec_factory(cls, **kwargs):
|
||||
except Exception:
|
||||
continue
|
||||
else:
|
||||
setattr(_inst, key, val)
|
||||
setattr(_inst, _inst.c_attributes[key][0], val)
|
||||
elif key in _inst.c_child_order:
|
||||
for tag, _cls in _inst.c_children.values():
|
||||
if tag == key:
|
||||
|
Reference in New Issue
Block a user