about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2019-06-06 12:45:02 -0500
committerzsloan2019-06-06 12:45:02 -0500
commitc0aa776c39b00d8a7a90f304db0560d9bc2d0646 (patch)
tree121657280ee7ff3eeabe0a47f403e7ceea0cc180
parentc898381788574b70a3f85c145eb8fcd5d7af7ca0 (diff)
downloadgenenetwork2-c0aa776c39b00d8a7a90f304db0560d9bc2d0646.tar.gz
Replaced ISNULL with IFNULL (which is the correct version for MySQL)
Changed the query form for getting a species' groups
-rw-r--r--wqflask/wqflask/api/router.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py
index 64552fa5..8e2cbbdc 100644
--- a/wqflask/wqflask/api/router.py
+++ b/wqflask/wqflask/api/router.py
@@ -58,12 +58,12 @@ def get_species_info(species_name, file_format = "json"):
     return flask.jsonify(species_dict)
 
 @app.route("/api/v_{}/groups".format(version))
-@app.route("/api/v_{}/<path:species_name>/groups".format(version))
+@app.route("/api/v_{}/groups/<path:species_name>".format(version))
 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,
-                                         ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
+                                         IFNULL(InbredSet.MappingMethodId, "None"), IFNULL(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, 
-                                         ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
+                                         IFNULL(InbredSet.MappingMethodId, "None"), IFNULL(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, 
-                                         ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
+                                         IFNULL(InbredSet.MappingMethodId, "None"), IFNULL(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, 
-                                         ISNULL(InbredSet.MappingMethodId, "None"), ISNULL(InbredSet.GeneticType, "None")
+                                         IFNULL(InbredSet.MappingMethodId, "None"), IFNULL(InbredSet.GeneticType, "None")
                                   FROM InbredSet
                                   WHERE (InbredSet.InbredSetName = "{0}" OR
                                          InbredSet.Name = "{0}" OR