I’m working with the freshbooks api using the refreshbooks[1] python script they’ve created. I’m limited to 100 results per call, so I was trying to put a group of calls together to put together a large list of elements to use with jquery datatables. My question is how do I concat two of these element trees?
Here are two simple calls that grab one result at a time:
client_response = c.client.list(
per_page=1,
page=1
)
client_response2 = c.client.list(
per_page=1,
page=2
)
And the basic response in client_response.clients looks like:
<clients xmlns="http://www.freshbooks.com/api/" page="1" per_page="1" pages="2" total="2">
<client>...</client>
</clients>
I’ve tried treating them as lists and using .extend but have had no luck.
Updated: the objects are actually lxml.objectify.ObjectifiedElement objects, not truly trees, but my question still stands on how to concat these…
I was able to concatenate these items into list by first converting the items to lists then extending: