diff options
author | Alexander Kabui | 2021-07-12 12:27:45 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-07-12 12:27:45 +0300 |
commit | 8b565a25b643e7ad653cb2c17d6456d073245dc5 (patch) | |
tree | 961cf33072c6089583f87d39539c53e0d5dd986a /wqflask/base/trait.py | |
parent | 3a9ef933faec1f14560b1f6ced9fcd4413089770 (diff) | |
parent | 344d6a86d2e468249ec7b583e8c0751f99cd6a5b (diff) | |
download | genenetwork2-8b565a25b643e7ad653cb2c17d6456d073245dc5.tar.gz |
fix merge conflict
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r-- | wqflask/base/trait.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index d09cfd40..10851e00 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -284,17 +284,19 @@ def get_sample_data(): return None -def jsonable(trait): +def jsonable(trait, dataset=None): """Return a dict suitable for using as json Actual turning into json doesn't happen here though""" - dataset = create_dataset(dataset_name=trait.dataset.name, - dataset_type=trait.dataset.type, - group_name=trait.dataset.group.name) + if not dataset: + dataset = create_dataset(dataset_name=trait.dataset.name, + dataset_type=trait.dataset.type, + group_name=trait.dataset.group.name) if dataset.type == "ProbeSet": return dict(name=trait.name, + view=trait.view, symbol=trait.symbol, dataset=dataset.name, dataset_name=dataset.shortname, @@ -308,37 +310,44 @@ def jsonable(trait): elif dataset.type == "Publish": if trait.pubmed_id: return dict(name=trait.name, + view=trait.view, dataset=dataset.name, dataset_name=dataset.shortname, description=trait.description_display, abbreviation=trait.abbreviation, authors=trait.authors, + pubmed_id=trait.pubmed_id, pubmed_text=trait.pubmed_text, pubmed_link=trait.pubmed_link, + mean=trait.mean, lrs_score=trait.LRS_score_repr, lrs_location=trait.LRS_location_repr, additive=trait.additive ) else: return dict(name=trait.name, + view=trait.view, dataset=dataset.name, dataset_name=dataset.shortname, description=trait.description_display, abbreviation=trait.abbreviation, authors=trait.authors, pubmed_text=trait.pubmed_text, + mean=trait.mean, lrs_score=trait.LRS_score_repr, lrs_location=trait.LRS_location_repr, additive=trait.additive ) elif dataset.type == "Geno": return dict(name=trait.name, + view=trait.view, dataset=dataset.name, dataset_name=dataset.shortname, location=trait.location_repr ) elif dataset.name == "Temp": return dict(name=trait.name, + view=trait.view, dataset="Temp", dataset_name="Temp") else: |