def excel(self): excel = RegistrantsListToExcel(self._conf, list=self._list, display=self._display, excelSpecific=self._excelSpecific) return send_file('RegistrantsList.csv', StringIO(excel.getExcelFile()), 'CSV')
def excel( self ): filename = "RegistrantsList.csv" excel = RegistrantsListToExcel(self._conf,list=self._list, display=self._display, excelSpecific=self._excelSpecific) data = excel.getExcelFile() self._rh._req.set_content_length(len(data)) cfg = Config.getInstance() mimetype = cfg.getFileTypeMimeType( "CSV" ) self._rh._req.content_type = """%s"""%(mimetype) self._rh._req.headers_out["Content-Disposition"] = """inline; filename="%s\""""%filename return data