Thursday, October 23, 2008

Generate Excel/CSV on the fly

by Kevin Fricovsky

Transform a QuerySet, or sequence of sequences, into either an Excel spreadsheet or CSV file formatted for Excel, depending on the amount of data. All of this is done in-memory and on-the-fly, with no disk writes, thanks to the cStringIO library. Requires the xlwt library. Implemented as a subclass of HttpResponse.

Bookmark and Share

Continue reading… Join the Discussion, 0 people have left comments.

Tags/Topics view all