Closed Shin-- closed 3 years ago
lgtm @FlipperPA do you have a timeframe for merging?
@Shin-- @willtho89 I'm reviewing this today - work has been crazy and today is my first day off! The concept looks good, I just need to dive into the details.
@Shin-- Thanks for the contribution! This has been released as version 0.4.0
on PyPI with a few fixes:
False
with return False
and removed an overkill functionThanks again - enjoy!
When serialising, we iterate through the headers we find in the first result:
Let's say the response looks like this:
This will lead to the headers
title, some_relation.id, some_relation.title, some_value
. While this works for the first result, the second row will have less values and therefore shiftsome_value
to the left, ending up in the column ofsome_relation.title
, with the one most right being empty.A second problem would be when the second result in the example would actually be the first. In that case we would end up with incomplete headers.
I changed the flattening to use the serializer instead and iterate through all header keys for each result, to keep the correct order and not end up with shifted values.
I also added a property
xlsx_use_labels
that uses field labels instead of keys.Update 25.03.2021:
Since this PR is still not merged or responded to, and I needed to add more functionality based on this commit, this is much more than a bugfix now: