nickesk / pyactiveresource

Automatically exported from code.google.com/p/pyactiveresource
Other
0 stars 0 forks source link

[PATCH] Attributes not deserialized on elements with children #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Call `xml_to_dict` for an element which has child elements and attributes. For 
example on the following XML fragment (Fragment of a result of a query to the 
redmine issue api):
{{{
<custom_field name="custom1" id="1">
  <value>cust1</value>
</custom_field>
}}}

Expected:
{{{
{'custom_field': {
  'name': 'custom1',
  'id': '1',
  'value': 'cust1'}
}
}}}

Actual (attributes name and id stripped, child element contained):
{{{
{'custom_field': {
  'value': 'cust1'}
}
}}}

r77 is affected by this problem. Tested on Ubuntu 10.10 / Python 2.6.6. Patch 
with fix and unit test attached.

Original issue reported on code.google.com by lorenz.s...@gmail.com on 30 Jan 2011 at 2:08

Attachments:

GoogleCodeExporter commented 9 years ago
This has finally been committed. Thanks for the patch and sorry about the 
really long delay.

Original comment by mark.r.r...@gmail.com on 19 Apr 2012 at 3:04