Summary
Add a read-only admin interface for the legacy NMA_MinorTraceChemistry table in starlette-admin.
Background
The Minor and Trace Chemistry data is legacy data imported from the AMPAPI system. It contains analytical results for various chemical elements and compounds, linked to ChemistrySampleInfo records.
Implementation
- Read-only view: Create, edit, and delete operations are disabled since this is legacy data
- Parent association: Uses
HasOne field to link to the parent ChemistrySampleInfo record
- List view: Shows key columns (GlobalID, Chemistry Sample Info, Analyte, Sample Value, Units, Symbol, Analysis Date, Agency)
- Search: Searchable by analyte, symbol, analysis method, notes, and agency
- Pagination: 50 records per page with options for 25, 50, 100, 200
Files Changed
admin/views/minor_trace_chemistry.py - New admin view class
admin/views/__init__.py - Export MinorTraceChemistryAdmin
admin/config.py - Register view with admin
features/admin/minor_trace_chemistry_admin.feature - BDD feature file
tests/test_admin_minor_trace_chemistry.py - Unit tests (14 tests)
Testing
- All 14 unit tests pass
- Tests verify: registration, read-only restrictions, list/form field configuration, labels
Related
- Parent model: ChemistrySampleInfo
- Similar views: RadionuclidesAdmin, HydraulicsDataAdmin
Summary
Add a read-only admin interface for the legacy NMA_MinorTraceChemistry table in starlette-admin.
Background
The Minor and Trace Chemistry data is legacy data imported from the AMPAPI system. It contains analytical results for various chemical elements and compounds, linked to ChemistrySampleInfo records.
Implementation
HasOnefield to link to the parent ChemistrySampleInfo recordFiles Changed
admin/views/minor_trace_chemistry.py- New admin view classadmin/views/__init__.py- Export MinorTraceChemistryAdminadmin/config.py- Register view with adminfeatures/admin/minor_trace_chemistry_admin.feature- BDD feature filetests/test_admin_minor_trace_chemistry.py- Unit tests (14 tests)Testing
Related