about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/dbFunction/webqtlDatabaseFunction.py13
-rw-r--r--wqflask/utility/tools.py1
-rw-r--r--wqflask/wqflask/user_manager.py4
3 files changed, 7 insertions, 11 deletions
diff --git a/wqflask/dbFunction/webqtlDatabaseFunction.py b/wqflask/dbFunction/webqtlDatabaseFunction.py
index b14c9312..846d5146 100644
--- a/wqflask/dbFunction/webqtlDatabaseFunction.py
+++ b/wqflask/dbFunction/webqtlDatabaseFunction.py
@@ -80,16 +80,11 @@ def retrieve_species(group):
         result = fetchone("select Species.Name from Species, InbredSet where InbredSet.Name = '%s' and InbredSet.SpeciesId = Species.Id" % (group))
         return result[0]
 
-###########################################################################
-#input: cursor, groupName (string)
-#output: mappingMethodId (int) info, value will be Null or else
-#function: retrieve mappingMethodId info from InbredSet table
-###########################################################################
-
 def getMappingMethod(cursor=None, groupName=None):
-    cursor.execute("select MappingMethodId from InbredSet where Name= '%s'" % groupName)
-    mappingMethodId = cursor.fetchone()[0]
-    return mappingMethodId
+    if USE_GN_SERVER:
+        return gn_server("/cross/"+group+".json")["mapping_method_id"]
+    else:
+        return fetchone("select MappingMethodId from InbredSet where Name= '%s'" % groupName)
 
 ###########################################################################
 #input: cursor, inbredSetId (int), strainId (int)
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index c1b635e0..0df471fc 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -171,6 +171,7 @@ WEBSERVER_MODE     = get_setting('WEBSERVER_MODE')
 LOG_LEVEL          = get_setting('LOG_LEVEL')
 LOG_LEVEL_DEBUG    = get_setting_int('LOG_LEVEL_DEBUG')
 LOG_SQL            = get_setting_bool('LOG_SQL')
+LOG_SQLALCHEMY     = get_setting_bool('LOG_SQLALCHEMY')
 LOG_BENCH          = get_setting_bool('LOG_BENCH')
 USE_REDIS          = get_setting_bool('USE_REDIS')
 USE_GN_SERVER      = get_setting_bool('USE_GN_SERVER')
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 6c67cc87..10fac06d 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -46,7 +46,7 @@ from wqflask.database import db_session
 from wqflask import model
 
 from utility import Bunch, Struct, after
-from utility.tools import LOG_SQL
+from utility.tools import LOG_SQL, LOG_SQLALCHEMY
 
 import logging
 from utility.logger import getLogger
@@ -145,7 +145,7 @@ class UserSession(object):
         """Actual sqlalchemy record"""
         # Only look it up once if needed, then store it
         try:
-            if LOG_SQL:
+            if LOG_SQLALCHEMY:
                 logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG)
 
             # Already did this before