diff options
author | zsloan | 2019-11-05 13:25:02 -0600 |
---|---|---|
committer | zsloan | 2019-11-05 13:25:02 -0600 |
commit | 2a4972137fde9a94fcaf59fc1a64a816d0a72f50 (patch) | |
tree | e6a60f60565c3e0345e75045b3d5933df306fa1a | |
parent | 28728a489f89e70eac6d7a30ffb5174641e79063 (diff) | |
download | genenetwork2-2a4972137fde9a94fcaf59fc1a64a816d0a72f50.tar.gz |
Fixed issue with ordering items in correlation dataset select dropdown
-rw-r--r-- | wqflask/base/data_set.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 16720656..d9b7f668 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -418,7 +418,8 @@ def datasets(group_name, this_group = None): WHERE PublishFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = '%s' and PublishFreeze.public > %s - and PublishFreeze.confidentiality < 1) + and PublishFreeze.confidentiality < 1 + ORDER BY PublishFreeze.Id ASC) UNION (SELECT '#GenoFreeze',GenoFreeze.FullName,GenoFreeze.Name FROM GenoFreeze, InbredSet @@ -442,12 +443,21 @@ def datasets(group_name, this_group = None): sorted_results = sorted(the_results, key=lambda kv: kv[0]) + pheno_inserted = False #ZS: This is kind of awkward, but need to ensure Phenotypes show up before Genotypes in dropdown + geno_inserted = False for dataset_item in sorted_results: tissue_name = dataset_item[0] dataset = dataset_item[1] dataset_short = dataset_item[2] if tissue_name in ['#PublishFreeze', '#GenoFreeze']: - dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)])) + if tissue_name == '#PublishFreeze' and (dataset_short == group_name + 'Publish'): + dataset_menu.insert(0, dict(tissue=None, datasets=[(dataset, dataset_short)])) + pheno_inserted = True + elif pheno_inserted and tissue_name == '#GenoFreeze': + dataset_menu.insert(1, dict(tissue=None, datasets=[(dataset, dataset_short)])) + geno_inserted = True + else: + dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)])) else: tissue_already_exists = False for i, tissue_dict in enumerate(dataset_menu): |