From 046a4a1210baf3a813936617bfc05a723dcbc82e Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Wed, 17 Apr 2024 21:28:35 +0530 Subject: [PATCH 1/3] AREG-129 - change the column position of accession in Antibody - django backoffice --- applications/portal/backend/api/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/portal/backend/api/admin.py b/applications/portal/backend/api/admin.py index 9983153e..8cd85c03 100644 --- a/applications/portal/backend/api/admin.py +++ b/applications/portal/backend/api/admin.py @@ -111,7 +111,7 @@ class AntibodyAdmin(ImportExportModelAdmin): # list display settings list_filter = ("status",) - list_display = (id_with_ab, "ab_name", "submitter_name", "status", "vendor", "catalog_num", "accession", "insert_time") + list_display = (id_with_ab, "accession", "ab_name", "submitter_name", "status", "vendor", "catalog_num", "insert_time") search_fields = ("ab_id", "ab_name", "catalog_num") # Edit form settings From fc806f6051e7c242cb0f16a8ee81383c18d20bac Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 18 Apr 2024 17:23:07 +0530 Subject: [PATCH 2/3] AREG-129 - Rearrange the order of fields in AntibodyAdmin detail --- applications/portal/backend/api/admin.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/applications/portal/backend/api/admin.py b/applications/portal/backend/api/admin.py index 8cd85c03..c0c7ec79 100644 --- a/applications/portal/backend/api/admin.py +++ b/applications/portal/backend/api/admin.py @@ -99,6 +99,17 @@ class AntibodyFilesAdmin(admin.TabularInline): exclude = ("uploader_uid", 'filehash', 'timestamp', 'display_name') extra = 1 + +antibody_fields_shown = ( + "ab_name", "ab_id", "accession", "commercial_type", "catalog_num", "cat_alt", "vendor", + "url","ab_target", "entrez_id", "uniprot_id", "target_species_raw", "subregion", + "modifications", "epitope", "source_organism", "clonality", "clone_id", "product_isotype", + "product_conjugate", "defining_citation", "product_form", "comments", "applications", + "kit_contents", "feedback", "curator_comment", "disc_date", "status", "show_link", + # also in the read-only fields + "uid", "uid_legacy", "insert_time", "lastedit_time", "curate_time", +) + @admin.register(Antibody) class AntibodyAdmin(ImportExportModelAdmin): @@ -114,8 +125,9 @@ class AntibodyAdmin(ImportExportModelAdmin): list_display = (id_with_ab, "accession", "ab_name", "submitter_name", "status", "vendor", "catalog_num", "insert_time") search_fields = ("ab_id", "ab_name", "catalog_num") - # Edit form settings - exclude= ("catalog_num_search",) + # not in fields - catalog_num_search + # the following - maintains the order of the fields + fields = antibody_fields_shown inlines = [TargetSpeciesInlineAdmin, AntibodyFilesAdmin] From 8fbefacfc5e661236233a3ef0014e61435de51aa Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 18 Apr 2024 17:24:12 +0530 Subject: [PATCH 3/3] AREG-129 cleanup comment change --- applications/portal/backend/api/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/portal/backend/api/admin.py b/applications/portal/backend/api/admin.py index c0c7ec79..a90affaf 100644 --- a/applications/portal/backend/api/admin.py +++ b/applications/portal/backend/api/admin.py @@ -100,6 +100,7 @@ class AntibodyFilesAdmin(admin.TabularInline): extra = 1 +# not in fields - catalog_num_search antibody_fields_shown = ( "ab_name", "ab_id", "accession", "commercial_type", "catalog_num", "cat_alt", "vendor", "url","ab_target", "entrez_id", "uniprot_id", "target_species_raw", "subregion", @@ -125,7 +126,6 @@ class AntibodyAdmin(ImportExportModelAdmin): list_display = (id_with_ab, "accession", "ab_name", "submitter_name", "status", "vendor", "catalog_num", "insert_time") search_fields = ("ab_id", "ab_name", "catalog_num") - # not in fields - catalog_num_search # the following - maintains the order of the fields fields = antibody_fields_shown