(self, data, title='report', header=None, widths=None)
return myfile
Make a list into a csv response for download.
Make a list into a csv response for download.
Make a list into a csv response for download .
def list_to_csv_file(self, data, title='report', header=None, widths=None):
        """ Make a list into a csv response for download.
        """
        wb = self.list_to_workbook(data, title, header, widths)
        if not title.endswith('.csv'):
            title += '.csv'
        myfile = StringIO()
        sh = wb.active
        c = csv.writer(myfile)
        for r in sh.rows:
            c.writerow([cell.value for cell in r])
        return myfile
def list_to_csv_file ( self , data , title = 'report' , header = None , widths = None ) : wb = self . list_to_workbook ( data , title , header , widths ) if not title . endswith ( '.csv' ) : title += '.csv' myfile = StringIO ( ) sh = wb . active c = csv . writer ( myfile ) for r in sh . rows : c . writerow ( [ cell . value for cell in r ] ) return myfile