mjumbewu / django-rest-framework-csv

CSV Tools for Django REST Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output CSV without header

VidJa opened this issue · comments

commented

How do I output CSV without a header, if I make the header None, no data is rendered.

I've tried:

class HeaderlessRenderer(csvrenderer.CSVRenderer):
    header = None

@api_view(['GET'])
@renderer_classes((HeaderlessRenderer))
def infosheet(request, analysisid, **kwargs):
    ....

@VidJa There's no configuration options right now to omit the header entirely. I'd be willing to discuss design and perhaps accept a pull request for such a thing, but is stripping out the header row something you can handle on the client side?

@mjumbewu this option should be added. header row needs to be hide when a lot of CSV files merging into each other to not show duplicate header rows.