From 764136ff18bd355f7b9dbe91f870919b0a17322e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 24 Jun 2016 06:51:28 +0000 Subject: Log: and document SQL calls --- wqflask/base/data_set.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index ffc5917a..c70738f7 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -711,12 +711,14 @@ class PhenotypeDataSet(DataSet): this_trait.LRS_location_value = 1000000 if this_trait.lrs: - result = g.db.execute(""" + query = """ select Geno.Chr, Geno.Mb from Geno, Species where Species.Name = %s and Geno.Name = %s and Geno.SpeciesId = Species.Id - """, (species, this_trait.locus)).fetchone() + """ % (species, this_trait.locus) + logger.sql(query) + result = g.db.execute(query).fetchone() if result: if result[0] and result[1]: @@ -1172,9 +1174,9 @@ def geno_mrna_confidentiality(ob): #logger.debug("dataset_table [%s]: %s" % (type(dataset_table), dataset_table)) query = '''SELECT Id, Name, FullName, confidentiality, - AuthorisedUsers FROM %s WHERE Name = %%s''' % (dataset_table) + AuthorisedUsers FROM %s WHERE Name = "%s"''' % (dataset_table,ob.name) logger.sql(query) - result = g.db.execute(query, ob.name) + result = g.db.execute(query) (dataset_id, name, -- cgit v1.2.3