From 04b61737236b837e91355b66cbaab3549bc39140 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 16 May 2013 23:31:54 +0000 Subject: Made the first level of quick search tabs species, followed by trait type (was the opposite before Rob commented on it earlier today) --- wqflask/wqflask/search_results.py | 19 ++++--- wqflask/wqflask/templates/quick_search.html | 86 +++++++++++------------------ 2 files changed, 45 insertions(+), 60 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index 5f3c036f..9b2751e0 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -74,7 +74,6 @@ class SearchResultPage(object): self.search_terms = kw['q'] print("self.search_terms is: ", self.search_terms) self.quick_search() - self.get_group_species_tree() else: self.results = [] #self.quick_search = False @@ -144,12 +143,18 @@ class SearchResultPage(object): this_result['result_fields'] = json.loads(dbresult.result_fields) this_species = this_result['result_fields']['species'] this_group = this_result['result_fields']['group_name'] - if type_dict[dbresult.table_name] not in self.species_groups: - self.species_groups[type_dict[dbresult.table_name]] = {} - if this_species not in self.species_groups[type_dict[dbresult.table_name]]: - self.species_groups[type_dict[dbresult.table_name]][this_species] = collections.defaultdict(list) - if this_group not in self.species_groups[type_dict[dbresult.table_name]][this_species]: - self.species_groups[type_dict[dbresult.table_name]][this_species].append(this_group) + if this_species not in self.species_groups: + self.species_groups[this_species] = {} + if type_dict[dbresult.table_name] not in self.species_groups[this_species]: + self.species_groups[this_species][type_dict[dbresult.table_name]] = [] + if this_group not in self.species_groups[this_species][type_dict[dbresult.table_name]]: + self.species_groups[this_species][type_dict[dbresult.table_name]].append(this_group) + #if type_dict[dbresult.table_name] not in self.species_groups: + # self.species_groups[type_dict[dbresult.table_name]] = {} + #if this_species not in self.species_groups[type_dict[dbresult.table_name]]: + # self.species_groups[type_dict[dbresult.table_name]][this_species] = [] + #if this_group not in self.species_groups[type_dict[dbresult.table_name]][this_species]: + # self.species_groups[type_dict[dbresult.table_name]][this_species].append(this_group) self.results[type_dict[dbresult.table_name]].append(this_result) #print("results: ", pf(self.results['phenotype'])) diff --git a/wqflask/wqflask/templates/quick_search.html b/wqflask/wqflask/templates/quick_search.html index 9d5b0c74..5877a840 100644 --- a/wqflask/wqflask/templates/quick_search.html +++ b/wqflask/wqflask/templates/quick_search.html @@ -25,33 +25,31 @@ {% endif %} - -
To study a record, click on its ID below.
- Check records below and click Add button to add to selection.