Typo in your install thing
jonvaughan opened this issue · comments
In the readme it is missing an x from the end, should say pip install drf-renderer-xlsx
also couple of small other small things - in the renderer it will support unicode output if you put a u' in front of the substitution str:
for column in row.items():
column_count += 1
ws.cell(
row=row_count,
column=column_count,
**value=u'{}'.format(**
column[1],
),
and it goes wrong if you don't have a paginated results set, which you might not if you want to download all - a work around would be something like:
results = data['results'] if 'results' in data else data
for row in results:
# Reset the column count
column_count = 0
Sorry that these aren't in a PR
Thanks! I've fixed up the typo and will take a look at the rest when I'm back from holiday. I'm only support Python 3+ in my projects at this point, but will take a look at the pagination!
The pagination is acting as expected; when no parameters are passed, it falls back to the default Django REST Framework settings. Developers that want more rows can use limit
and offset
, but we should be cautious with that as OpenPyXL can quickly run a web node out of RAM, so I want it to be explicitly called by the developer. Thanks for the comments!