BDMS-501: Implement read-only admin view for NMAMinorTraceChemistry#434
Merged
chasetmartin merged 12 commits intoJan 29, 2026
Merged
Conversation
…rTraceChemistry This aligns with the 1:1 migration, preserving all legacy field names.
…gs for consistency and clarity
…e model, and aligned the admin tests with the new configuration. Details: - Added sample_pt_id, sample_point_id, object_id, and wclab_id to list/sort/search/form configs in admin/views/minor_trace_chemistry.py. - Updated field labels to match legacy column naming. - Adjusted expectations in tests/test_admin_minor_trace_chemistry.py to match the new fields/labels.
…xpects ("Analyte").
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the NMAMinorTraceChemistry model and admin view to align with legacy database field mappings and naming conventions. The changes ensure proper 1:1 migration compatibility by adding missing legacy fields and correcting foreign key references.
Changes:
- Renamed foreign key column from
chemistry_sample_info_idtosample_pt_idand updated unique constraint to reference correct legacy column nameAnalyte - Added missing legacy fields (
sample_point_id,object_id,wclab_id) with proper column mappings - Updated admin view configuration to include new fields in list, form, sortable, and searchable field sets
- Updated tests and view labels to reflect "NMA Minor Trace Chemistry" naming convention
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| db/nma_legacy.py | Updated model to use correct FK name, added missing legacy fields with proper column mappings, and fixed unique constraint |
| admin/views/minor_trace_chemistry.py | Added new fields to admin configuration including list, sortable, searchable fields and field labels |
| tests/test_admin_minor_trace_chemistry.py | Updated test assertions to expect "NMA Minor Trace Chemistry" label and verify new fields are present |
…Trace Chemistry view
- map SamplePtID in NMA_MinorTraceChemistry and fix unique constraint - update minor trace admin integration test for NMA label/sample_pt_id - add alembic migration to align legacy column names and merge heads
- rename expected FK field from chemistry_sample_info_id to sample_pt_id - include new legacy columns in expected minor trace model fields
- replace chemistry_sample_info_id with sample_pt_id in the admin feature field list - why: model/admin config now exposes the legacy SamplePtID mapping, so the feature spec must align with the current schema naming
chasetmartin
requested changes
Jan 27, 2026
- Update 3a9c1f5b7d2e to point at c1d2e3f4a5b6 - Remove the obsolete merge revision 4f6b7c8d9e0f - Reason: manual rebase to realign the migration chain after history changes and avoid a redundant merge node
chasetmartin
approved these changes
Jan 29, 2026
chasetmartin
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! I just noticed your updated names weren't being used in the transfer script, so I just pushed a quick update to change those names and the transfer was working on my end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?