aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-12-16 11:27:39 -0600
committerzsloan2020-12-16 11:27:39 -0600
commit87fdfc19009acda8b58729d0ffbdccbdf6a85a1e (patch)
treeaa6ac36942ec44a53b2466ccd618636be533db54 /wqflask
parent13ae2b093720a04b63f50a77b92e3b8e480b5ae1 (diff)
downloadgenenetwork2-87fdfc19009acda8b58729d0ffbdccbdf6a85a1e.tar.gz
Set all attribute names to lower-case for sorting in order to keep order consistent
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/show_trait/SampleList.py4
-rw-r--r--wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js2
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js2
3 files changed, 4 insertions, 4 deletions
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py
index 00495377..ece485ae 100644
--- a/wqflask/wqflask/show_trait/SampleList.py
+++ b/wqflask/wqflask/show_trait/SampleList.py
@@ -108,7 +108,7 @@ class SampleList(object):
FROM CaseAttribute, CaseAttributeXRefNew
WHERE CaseAttributeXRefNew.CaseAttributeId = CaseAttribute.Id
AND CaseAttributeXRefNew.InbredSetId = %s
- ORDER BY CaseAttribute.Name''', (str(self.dataset.group.id),))
+ ORDER BY lower(CaseAttribute.Name)''', (str(self.dataset.group.id),))
self.attributes = {}
for attr, values in itertools.groupby(results.fetchall(), lambda row: (row.Id, row.Name)):
@@ -157,7 +157,7 @@ class SampleList(object):
except ValueError:
pass
- attribute_values[self.attributes[item.Id].name] = attribute_value
+ attribute_values[self.attributes[item.Id].name.lower()] = attribute_value
self.sample_attribute_values[sample_name] = attribute_values
def get_first_attr_col(self):
diff --git a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
index 5a4f151c..4362a75e 100644
--- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
+++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js
@@ -93,7 +93,7 @@ build_columns = function() {
);
}
- attr_keys = Object.keys(js_data.attributes).sort((a, b) => (js_data.attributes[a].name > js_data.attributes[b].name) ? 1 : -1)
+ attr_keys = Object.keys(js_data.attributes).sort((a, b) => (js_data.attributes[a].name.toLowerCase() > js_data.attributes[b].name.toLowerCase()) ? 1 : -1)
for (i = 0; i < attr_keys.length; i++){
column_list.push(
{
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 5dc9e456..98f90f7d 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -571,7 +571,7 @@ populate_sample_attributes_values_dropdown = function() {
sample_attributes = [];
var attributes_as_list = Object.keys(js_data.attributes).map(function(key) {
- return [key, js_data.attributes[key].name];
+ return [key, js_data.attributes[key].name.toLowerCase()];
});
attributes_as_list.sort(function(first, second) {