aboutsummaryrefslogtreecommitdiff
path: root/wqflask/dbFunction/webqtlDatabaseFunction.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-19 08:50:55 +0000
committerPjotr Prins2016-06-19 08:50:55 +0000
commit2214650621ee57b4c427bf8b5cab1128eb06db93 (patch)
treeb1c29a7e9b99ced8d496497a6c9d8bcfdbc1932e /wqflask/dbFunction/webqtlDatabaseFunction.py
parent45bc57a19598c92fc4a64681bce629c1a74a03b8 (diff)
downloadgenenetwork2-2214650621ee57b4c427bf8b5cab1128eb06db93.tar.gz
Logger: started logging SQL
Diffstat (limited to 'wqflask/dbFunction/webqtlDatabaseFunction.py')
-rw-r--r--wqflask/dbFunction/webqtlDatabaseFunction.py34
1 files changed, 13 insertions, 21 deletions
diff --git a/wqflask/dbFunction/webqtlDatabaseFunction.py b/wqflask/dbFunction/webqtlDatabaseFunction.py
index 299114b4..1bc67992 100644
--- a/wqflask/dbFunction/webqtlDatabaseFunction.py
+++ b/wqflask/dbFunction/webqtlDatabaseFunction.py
@@ -20,13 +20,15 @@
#
# This module is used by GeneNetwork project (www.genenetwork.org)
-
from flask import Flask, g
import MySQLdb
import string
from base import webqtlConfig
+from utility.logger import getLogger
+logger = getLogger(__name__ )
+
###########################################################################
#output: cursor instance
#function: connect to database and return cursor instance
@@ -76,33 +78,23 @@ def getAllSpecies(cursor=None):
allSpecies = cursor.fetchall()
return allSpecies
-###########################################################################
-#input: cursor, RISet (string)
-#output: specie's name (string), value will be None or else
-#function: retrieve specie's name info based on RISet
-###########################################################################
-
def retrieve_species(group):
- return g.db.execute("""select Species.Name
- from Species, InbredSet
- where InbredSet.Name = %s and
- InbredSet.SpeciesId = Species.Id""", (group)).fetchone()[0]
+ logger.debug("retrieve_species",group)
+ logger.sql(""""select Species.Name from Species, InbredSet where InbredSet.Name = %s and InbredSet.SpeciesId = Species.Id""", (group))
+
+ return g.db.execute("""select Species.Name from Species, InbredSet where InbredSet.Name =
+%s and InbredSet.SpeciesId = Species.Id""", (group)).fetchone()[0]
def retrieve_species_id(group):
return g.db.execute("select SpeciesId from InbredSet where Name = %s", (group)).fetchone()[0]
-###########################################################################
-# input: cursor
-# output: tissProbeSetFreezeIdList (list),
-# nameList (list),
-# fullNameList (list)
-# function: retrieve all TissueProbeSetFreezeId,Name,FullName info
-# from TissueProbeSetFreeze table.
-# These data will listed in the dropdown menu in the first page of Tissue Correlation
-###########################################################################
-
def getTissueDataSet(cursor=None):
+ """Retrieve all TissueProbeSetFreezeId,Name,FullName info from
+TissueProbeSetFreeze table. These data will listed in the dropdown
+menu in the first page of Tissue Correlation
+
+ """
tissProbeSetFreezeIdList=[]
nameList =[]
fullNameList = []