Skip to content

BDMS-493: Implement read-only admin view for NMAChemistry_SampleInfo#460

Merged
jirhiker merged 7 commits intostagingfrom
kas-bdms-493-admin-view-NMAChemistrySampleInfo
Feb 4, 2026
Merged

BDMS-493: Implement read-only admin view for NMAChemistry_SampleInfo#460
jirhiker merged 7 commits intostagingfrom
kas-bdms-493-admin-view-NMAChemistrySampleInfo

Conversation

@ksmuczynski
Copy link
Contributor

Why

This PR addresses the following problem / context:

  • NMA Chemistry Sample Info admin view needed fuller legacy field coverage and more consistent labeling/order.
  • Admin UX needed a stable Thing relationship link for navigation.

How

Implementation summary - the following was changed / added / removed:

  • Expanded list_fields, sortable_fields, and searchable_fields with legacy columns and collection metadata in admin/views/chemistry_sampleinfo.py.
  • Added read-only behavior (no create/edit/delete) and a HasOne("thing") relationship link in admin/views/chemistry_sampleinfo.py.
  • Set ThingAdmin.identity = "thing" for stable relationship linking in admin/views/thing.py.
  • Updated view name/label and refined field labels in admin/views/chemistry_sampleinfo.py.

Notes

Any special considerations, workarounds, or follow-up work to note?

  • None noted.

… and configurations

- Keep existing field order/labels aligned with legacy model
- Set ThingAdmin.identity to thing for stable linking
- Add HasOne("thing") relationship link in Chemistry Sample Info list/detail
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a read-only admin view for NMA Chemistry Sample Info with expanded field coverage and improved navigation. The changes focus on making the view consistent with legacy field naming and preventing data modification through the admin interface.

Changes:

  • Made ChemistrySampleInfoAdmin read-only by disabling create, edit, and delete operations
  • Expanded visible, sortable, and searchable fields to include legacy columns and collection metadata
  • Added Thing relationship link for navigation and set stable identity on ThingAdmin

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
admin/views/thing.py Added stable identity attribute for relationship linking
admin/views/chemistry_sampleinfo.py Implemented read-only behavior, expanded field coverage, added Thing relationship, and updated labels

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 21:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Add missing "nma_" prefix

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 21:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@ksmuczynski ksmuczynski requested a review from Copilot February 2, 2026 21:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

ksmuczynski and others added 2 commits February 3, 2026 17:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 4, 2026 11:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 4, 2026 11:03
@jirhiker jirhiker merged commit b603a2c into staging Feb 4, 2026
4 of 5 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +50 to +57
def can_create(self, request: Request) -> bool:
return False

def can_edit(self, request: Request) -> bool:
return False

def can_delete(self, request: Request) -> bool:
return False
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Request type is referenced but not imported. Add 'from starlette.requests import Request' or the appropriate request type import for this codebase.

Copilot uses AI. Check for mistakes.
"nma_object_id",
"nma_location_id",
"thing_id",
HasOne("thing", identity="thing"),
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HasOne class is referenced but not imported. Add the appropriate import statement for HasOne at the top of the file.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants