def index(): filename = 'testrail-report-{0}.xlsx'.format(get_dt_iso()) report = MainReport(filename) report.generate() file_path = os.path.join(app.config['REPORTS_PATH'], filename) return send_file( file_path, mimetype='application/vnd.openxmlformats-officedocument.' 'spreadsheetml.sheet', as_attachment=True, attachment_filename=filename, cache_timeout=0)
def __str__(self): return '{0} - {1}'.format(get_dt_iso(self.started), get_dt_iso(self.finished) or '...')