aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-09-06 18:57:54 +0000
committerzsloan2022-09-06 18:57:54 +0000
commit5ba43e677addbe5eef4a88a2aa3f95c04c7ae657 (patch)
treea1a1478e292a496965e51040635f412cfbd1ef69
parentdbb95a22e2882ddb720aec37da0c0a9605066079 (diff)
downloadgenenetwork2-5ba43e677addbe5eef4a88a2aa3f95c04c7ae657.tar.gz
Fix error with dataset menu query in data_set.py
I'm only using g.db.execute here because using cursor is throwing an error and I don't want to change the way this query is currently written since I didn't write it (I believe it was initially written using g.db.execute and whoever wrote it just forgot to put the g.db.execute, since previously it just called "fetchall")
-rw-r--r--wqflask/base/data_set.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index f66bf186..742eb61c 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -476,28 +476,28 @@ class DatasetGroup:
def datasets(group_name, this_group=None):
key = "group_dataset_menu:v2:" + group_name
dataset_menu = []
- the_results = fetchall('''
- (SELECT '#PublishFreeze',PublishFreeze.FullName,PublishFreeze.Name
- FROM PublishFreeze,InbredSet
- WHERE PublishFreeze.InbredSetId = InbredSet.Id
+ the_results = g.db.execute('''
+ (SELECT '#PublishFreeze',PublishFreeze.FullName,PublishFreeze.Name
+ FROM PublishFreeze,InbredSet
+ WHERE PublishFreeze.InbredSetId = InbredSet.Id
and InbredSet.Name = '%s'
- ORDER BY PublishFreeze.Id ASC)
- UNION
- (SELECT '#GenoFreeze',GenoFreeze.FullName,GenoFreeze.Name
- FROM GenoFreeze, InbredSet
- WHERE GenoFreeze.InbredSetId = InbredSet.Id
+ ORDER BY PublishFreeze.Id ASC)
+ UNION
+ (SELECT '#GenoFreeze',GenoFreeze.FullName,GenoFreeze.Name
+ FROM GenoFreeze, InbredSet
+ WHERE GenoFreeze.InbredSetId = InbredSet.Id
and InbredSet.Name = '%s')
- UNION
- (SELECT Tissue.Name, ProbeSetFreeze.FullName,ProbeSetFreeze.Name
- FROM ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue
- WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id
+ UNION
+ (SELECT Tissue.Name, ProbeSetFreeze.FullName,ProbeSetFreeze.Name
+ FROM ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue
+ WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id
and ProbeFreeze.TissueId = Tissue.Id
and ProbeFreeze.InbredSetId = InbredSet.Id
and InbredSet.Name like %s
- ORDER BY Tissue.Name, ProbeSetFreeze.OrderList DESC)
+ ORDER BY Tissue.Name, ProbeSetFreeze.OrderList DESC)
''' % (group_name,
- group_name,
- "'" + group_name + "'"))
+ group_name,
+ "'" + group_name + "'")).fetchall()
sorted_results = sorted(the_results, key=lambda kv: kv[0])