aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-06-05 16:26:19 -0500
committerzsloan2019-06-05 16:26:19 -0500
commitc898381788574b70a3f85c145eb8fcd5d7af7ca0 (patch)
treeaceaa825e6ae03e0c84fd317722ee1fecc643cba /wqflask
parent38dd85ae47819190c5a3cc9e9a7269b44e92bb38 (diff)
downloadgenenetwork2-c898381788574b70a3f85c145eb8fcd5d7af7ca0.tar.gz
Ensured that a string is returned for SQL fields that can potentially be null
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/api/router.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py
index aab3d660..64552fa5 100644
--- a/wqflask/wqflask/api/router.py
+++ b/wqflask/wqflask/api/router.py
@@ -63,7 +63,7 @@ def get_groups_list(species_name=None):
if species_name:
results = g.db.execute("""SELECT InbredSet.InbredSetId, InbredSet.SpeciesId, InbredSet.InbredSetName,
InbredSet.Name, InbredSet.FullName, InbredSet.public,
- InbredSet.MappingMethodId, InbredSet.GeneticType
+ ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
FROM InbredSet, Species
WHERE InbredSet.SpeciesId = Species.Id AND
(Species.Name = "{0}" OR
@@ -72,7 +72,7 @@ def get_groups_list(species_name=None):
else:
results = g.db.execute("""SELECT InbredSet.InbredSetId, InbredSet.SpeciesId, InbredSet.InbredSetName,
InbredSet.Name, InbredSet.FullName, InbredSet.public,
- InbredSet.MappingMethodId, InbredSet.GeneticType
+ ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
FROM InbredSet;""")
the_groups = results.fetchall()
@@ -103,7 +103,7 @@ def get_group_info(group_name, species_name = None, file_format = "json"):
if species_name:
results = g.db.execute("""SELECT InbredSet.InbredSetId, InbredSet.SpeciesId, InbredSet.InbredSetName,
InbredSet.Name, InbredSet.FullName, InbredSet.public,
- InbredSet.MappingMethodId, InbredSet.GeneticType
+ ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
FROM InbredSet, Species
WHERE InbredSet.SpeciesId = Species.Id AND
(InbredSet.InbredSetName = "{0}" OR
@@ -115,7 +115,7 @@ def get_group_info(group_name, species_name = None, file_format = "json"):
else:
results = g.db.execute("""SELECT InbredSet.InbredSetId, InbredSet.SpeciesId, InbredSet.InbredSetName,
InbredSet.Name, InbredSet.FullName, InbredSet.public,
- InbredSet.MappingMethodId, InbredSet.GeneticType
+ ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
FROM InbredSet
WHERE (InbredSet.InbredSetName = "{0}" OR
InbredSet.Name = "{0}" OR