diff options
Diffstat (limited to 'wqflask/dbFunction/webqtlDatabaseFunction.py')
-rw-r--r-- | wqflask/dbFunction/webqtlDatabaseFunction.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/wqflask/dbFunction/webqtlDatabaseFunction.py b/wqflask/dbFunction/webqtlDatabaseFunction.py index d7e160d0..4a0fb40f 100644 --- a/wqflask/dbFunction/webqtlDatabaseFunction.py +++ b/wqflask/dbFunction/webqtlDatabaseFunction.py @@ -47,7 +47,7 @@ def getCursor(): except: return None -def fetchone(callername,query): +def fetchone(query): """Return tuple containing one row by calling SQL directly """ @@ -55,6 +55,7 @@ def fetchone(callername,query): def helper(query): res = g.db.execute(query) return res.fetchone() + callername = stack()[1][3] return logger.sql(callername, query, helper) def gn_server(path): @@ -73,10 +74,10 @@ def retrieve_species(group): """ if USE_GN_SERVER: - result = gn_server("/cross/"+group) + result = gn_server("/cross/"+group+".json") return result["species"] else: - result = fetchone(stack()[0][3],"select Species.Name from Species, InbredSet where InbredSet.Name = '%s' and InbredSet.SpeciesId = Species.Id" % (group)) + result = fetchone("select Species.Name from Species, InbredSet where InbredSet.Name = '%s' and InbredSet.SpeciesId = Species.Id" % (group)) return result[0] ########################################################################### |