aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/species.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-23 12:18:42 +0000
committerPjotr Prins2016-06-23 12:18:42 +0000
commit85644d74643f4fef3641b1ce3c7c437b08b9ee70 (patch)
tree26468cf2b9208633b7cbb97941101b181d3d7b39 /wqflask/base/species.py
parentda1db6ae1df0b5c3d539c1d8b2d78d05ebe393e1 (diff)
downloadgenenetwork2-85644d74643f4fef3641b1ce3c7c437b08b9ee70.tar.gz
Logger: SQL
Diffstat (limited to 'wqflask/base/species.py')
-rw-r--r--wqflask/base/species.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/wqflask/base/species.py b/wqflask/base/species.py
index 79d867c8..ce763fc3 100644
--- a/wqflask/base/species.py
+++ b/wqflask/base/species.py
@@ -10,6 +10,9 @@ from utility import Bunch
from pprint import pformat as pf
+from utility.logger import getLogger
+logger = getLogger(__name__ )
+
class TheSpecies(object):
def __init__(self, dataset):
self.dataset = dataset
@@ -48,16 +51,17 @@ class Chromosomes(object):
self.dataset = dataset
self.chromosomes = collections.OrderedDict()
- results = g.db.execute("""
+
+ query = """
Select
Chr_Length.Name, Chr_Length.OrderId, Length from Chr_Length, InbredSet
where
Chr_Length.SpeciesId = InbredSet.SpeciesId AND
- InbredSet.Name = %s
+ InbredSet.Name = '%s'
Order by OrderId
- """, self.dataset.group.name).fetchall()
- #print("group: ", self.dataset.group.name)
- #print("bike:", results)
+ """ % self.dataset.group.name
+ logger.sql(query)
+ results = g.db.execute(query).fetchall()
for item in results:
self.chromosomes[item.OrderId] = IndChromosome(item.Name, item.Length)
@@ -120,4 +124,4 @@ class Chromosomes(object):
# Testing
#if __name__ == '__main__':
-# foo = dict(bar=dict(length)) \ No newline at end of file
+# foo = dict(bar=dict(length))