aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Sloan2012-11-01 17:35:21 -0500
committerZachary Sloan2012-11-01 17:35:21 -0500
commit63faa277e4bf484f42e96e5064fbe6e31dfb331b (patch)
tree4cfa15b12de5fdd1d7b15cbe154cdfa8fd63ed4d
parentc0097b0021b0bff5b42658a279043a16bb4e9ad9 (diff)
downloadgenenetwork2-63faa277e4bf484f42e96e5064fbe6e31dfb331b.tar.gz
Changed the if/elif statements for the different dataset types to
use a dictionary instead
-rw-r--r--wqflask/wqflask/search_results.py22
-rw-r--r--wqflask/wqflask/templates/base.html2
2 files changed, 15 insertions, 9 deletions
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 51204ddf..c82f16c1 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -650,12 +650,19 @@ class SearchResultPage(templatePage):
if search_term:
- if self.dataset.type == "ProbeSet":
- search_ob = "ProbeSetSearch"
- elif self.dataset.type == "Publish":
- search_ob = "PhenotypeSearch"
- elif self.dataset.type == "Geno":
- search_ob = "GenotypeSearch"
+ searches = dict(
+ ProbeSet = "ProbeSetSearch",
+ Publish = "PhenotypeSearch",
+ Geno = "GenotypeSearch",
+ )
+ if self.dataset.type in searches:
+ search_ob = searches[self.dataset.type]
+ #if self.dataset.type == "ProbeSet":
+ # search_ob = "ProbeSetSearch"
+ #elif self.dataset.type == "Publish":
+ # search_ob = "PhenotypeSearch"
+ #elif self.dataset.type == "Geno":
+ # search_ob = "GenotypeSearch"
else:
SearchTermNeedsToBeDefined # Cause an error on purpose
search_class = getattr(do_search, search_ob)
@@ -665,8 +672,7 @@ class SearchResultPage(templatePage):
self.db_conn).run()
print("in the search results are:", results)
-#
-#
+
## clause_item = (
##""" MATCH (ProbeSet.Name,
## ProbeSet.description,
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index b54d3424..21b93004 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -148,7 +148,7 @@
</script>
<script src="/static/new/js_external/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/new/js_external/json2.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js" type="text/javascript"></script>
+ <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js" type="text/javascript"></script>
{% block js %}
{% endblock %}
</body>