#32326: Proposing a more concrete example of 'Streaming large CSV files'
-------------------------------------+-------------------------------------
Reporter: niauah | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: wontfix
Keywords: streamingresponse | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by niauah):
Replying to [comment:1 Mariusz Felisiak]:
> Thanks for this proposition, however the current example is sufficient
for Django documentation, IMO. We already have an extensive docs and we
cannot document each use case and non-Django caveats.
Thanks for the reply. I understand that the document cannot cover detailed
non-Django caveats (e.g. issues on Python methods). If necessary, I can
revise the patch and delete them.
However, in the original example:
{{{
rows = (["Row {}".format(idx), str(idx)] for idx in range(65536))
pseudo_buffer = Echo()
writer = csv.writer(pseudo_buffer)
response = StreamingHttpResponse((writer.writerow(row) for row in
rows),
content_type="text/csv")
}}}
the 65536-row list is fully traversed at declaration, not in a 'call-by-
need' fashion.
IMO, providing an example combined with yield method would be more
illustrative of the 'streaming' nature.
--
Ticket URL: <https://code.djangoproject.com/ticket/32326#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.af9098d24542221fa069c35ef295ecfd%40djangoproject.com.