Skip to content

Conversation

snyaggarwal
Copy link

Slight variation of existing feature, wherein, Response is rendered.
This method will just return the file, and then based on the need app logic can do more things on csv (like uploading it to S3, and return the Response with S3 URL).

@coveralls
Copy link

coveralls commented Oct 4, 2016

Coverage Status

Coverage decreased (-6.1%) to 93.893% when pulling 2c3315c on snyaggarwal:master into 3ab7a2c on azavea:master.

@maurizi
Copy link
Contributor

maurizi commented Oct 4, 2016

Thank you for your contribution! Unfortunately, I don't think this is functionality that we want to add to this library at this time.

To emulate similar functionality, you can use the existing write_csv function directly from your program:

queryset = ...
with open('my-file-name.csv', 'w') as file_handle:
   write_csv(queryset, file_handle)

I'm curious, since you mention wanting this to be able to upload to S3, why not just use write_csv and pass it a file-like object such as BytesIO?
This would be better for uploading to S3, since you'll avoid creating any files locally.

@maurizi maurizi closed this Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants