Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AREG-129 - change the position of accession in Antibody admin- keep next to ab_id #241

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions applications/portal/backend/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ class AntibodyFilesAdmin(admin.TabularInline):
exclude = ("uploader_uid", 'filehash', 'timestamp', 'display_name')
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",
"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):

Expand All @@ -111,11 +123,11 @@ 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
exclude= ("catalog_num_search",)
# the following - maintains the order of the fields
fields = antibody_fields_shown

inlines = [TargetSpeciesInlineAdmin, AntibodyFilesAdmin]

Expand Down
Loading