aboutsummaryrefslogtreecommitdiff
path: root/uploader
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-04-14 15:11:57 -0500
committerFrederick Muriuki Muriithi2025-04-14 16:09:21 -0500
commit03a0b20ab147f43989bc92f2ccc24459b573a557 (patch)
tree4f95aa69636f5021867dc5aaa7a8bd3b1e89bf00 /uploader
parent3cd56ff2f774c13add3b5fa791fcc55a0c5f00c3 (diff)
downloadgn-uploader-03a0b20ab147f43989bc92f2ccc24459b573a557.tar.gz
Move common fieldnames into exportable variable.
Diffstat (limited to 'uploader')
-rw-r--r--uploader/phenotypes/views.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index d2c5be1..cf1f5c7 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -868,6 +868,17 @@ def process_phenotype_data_for_download(pheno: dict) -> dict:
}
+BULK_EDIT_COMMON_FIELDNAMES = [
+ "UniqueIdentifier",
+ "Post_publication_description",
+ "Pre_publication_abbreviation",
+ "Pre_publication_description",
+ "Original_description",
+ "Post_publication_abbreviation",
+ "PubMed_ID"
+]
+
+
@phenotypesbp.route(
"<int:species_id>/populations/<int:population_id>/phenotypes/datasets"
"/<int:dataset_id>/edit-download",
@@ -915,15 +926,9 @@ def edit_download_phenotype_data(# pylint: disable=[unused-argument]
"comment line. This line, and all the lines above it, are "
"all comment lines. Comment lines will be ignored.\n")
writer = csv.DictWriter(outfile,
- fieldnames=[
- "UniqueIdentifier",
- "Post_publication_description",
- "Pre_publication_abbreviation",
- "Pre_publication_description",
- "Original_description",
- "Post_publication_abbreviation",
- "PubMed_ID"
- ] + samples_list,
+ fieldnames= (
+ BULK_EDIT_COMMON_FIELDNAMES +
+ samples_list),
dialect="excel-tab")
writer.writeheader()
writer.writerows(data)