From e5db09b6da841eb077335a50c2dba1326d8dd670 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 26 Jun 2016 09:54:28 +0000 Subject: gn_server: simplify --- wqflask/base/data_set.py | 8 ++------ wqflask/db/call.py | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index ec3750dd..e0bf5f40 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -488,18 +488,14 @@ class DataSet(object): self.name, self.name)) - # self.id, self.name, self.fullname, self.shortname, self.data_scale, self.tissue = - result = fetch1(""" + self.id, self.name, self.fullname, self.shortname, self.data_scale, self.tissue = fetch1(""" SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName, ProbeSetFreeze.ShortName, ProbeSetFreeze.DataScale, Tissue.Name FROM ProbeSetFreeze, ProbeFreeze, Tissue WHERE ProbeSetFreeze.public > %s AND ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND ProbeFreeze.TissueId = Tissue.Id AND (ProbeSetFreeze.Name = '%s' OR ProbeSetFreeze.FullName = '%s' OR ProbeSetFreeze.ShortName = '%s') - """ % (query_args), - "/dataset/"+self.name+".json",helper) - self.id, self.name, self.fullname, self.shortname, self.data_scale, self.tissue = result - logger.debug("retrieve_other_names result:",result) + """ % (query_args),"/dataset/"+self.name+".json",helper) else: query_args = tuple(escape(x) for x in ( (self.type + "Freeze"), diff --git a/wqflask/db/call.py b/wqflask/db/call.py index 6c195afa..1a1b3adc 100644 --- a/wqflask/db/call.py +++ b/wqflask/db/call.py @@ -25,7 +25,9 @@ GN_SERVER result when set (which should return a Tuple) res2 = func(result) else: res2 = result, - logger.debug(path,query,res2) + if LOG_SQL: + logger.debug("Replaced SQL call",query) + logger.debug(path,res2) return res2 else: return fetchone(query) -- cgit v1.2.3