From: Karl O. Pinc Date: Sun, 29 Sep 2024 22:03:04 +0000 (-0500) Subject: Make the Include SQL (in the download) checkbox work X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=f9b84b2fa9a75c0ffc894f50cfeb43e5733b90b7;p=pgwui_sql Make the Include SQL (in the download) checkbox work --- diff --git a/src/pgwui_sql/views/sql.py b/src/pgwui_sql/views/sql.py index b3acd11..cdc2fe2 100644 --- a/src/pgwui_sql/views/sql.py +++ b/src/pgwui_sql/views/sql.py @@ -282,6 +282,8 @@ class SQLResultsHandler(pgwui_core.core.SessionDBHandler): if downloading: self.tfile = tempfile.TemporaryFile(mode='w+t', newline='') writer = self.make_csv_writer() + if self.uf['include_sql']: + writer.writerow((self.uf['sql'].rstrip(),)) for sql_result in sql_results: writer.writerow((sql_result.statusmessage.data,)) writer.writerow(sql_result.heading.data)