django-rest-framework-csv icon indicating copy to clipboard operation
django-rest-framework-csv copied to clipboard

Include a paginated renderer as part of the app

Open lylepratt opened this issue 11 years ago • 3 comments
trafficstars

Thanks for this great add-on!

For some reason when I download my data in CSV format, it is returned in 2 giant rows, with all items combined on the rows.

Screenshot: https://www.dropbox.com/s/8aecjorj658om2s/Screenshot%202014-05-22%2009.47.49.png

Why is this happening and how do I get it to correctly export the rows?

Thanks, Lyle

lylepratt avatar May 22 '14 14:05 lylepratt

Hey @lylepratt,

Sorry for the delay here. This is happening because the renderer doesn't automatically know how to deal with pagination. There is an example of what to do in the README though: https://github.com/mjumbewu/django-rest-framework-csv/blob/master/README.rst#pagination

I'm pretty sure someone ran in to this before. This renderer should probably be a proper part of the app.

EDIT: I've updated the title of the ticket.

mjumbewu avatar Jun 18 '14 01:06 mjumbewu

I think it would be a good idea to add the PaginatedCSVRenderer in https://github.com/mjumbewu/django-rest-framework-csv/blob/master/rest_framework_csv/renderers.py and ship it as part of django-rest-framework-csv — so users don't have top copy&paste it from the README to their own application but can just do

from rest_framework_csv.renderers import PaginatedCSVRenderer

should I create a separate issue for that ?

peritus avatar Mar 19 '15 11:03 peritus

If I have globally setted 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', for all my JSON rendered endpoints, I can't see anything in my single CSV endpoint. How I can switch off pagination for exactly CSV endpoint?

Guest007 avatar Aug 08 '16 19:08 Guest007