BDMS-500: Implement read-only admin view for NMAWaterLevelsContinuousPressureDaily#439
BDMS-500: Implement read-only admin view for NMAWaterLevelsContinuousPressureDaily#439ksmuczynski wants to merge 14 commits intostagingfrom
Conversation
…uous_Pressure_Daily Context: updates db/nma_legacy.py to map GlobalID and WellID as UUID(as_uuid=True) and documents the WellID FK to Thing for the continuous pressure daily model.
- Define read-only Starlette Admin view with full legacy-order fields - Register view in admin/views/__init__.py and admin/config.py
…acy.py for UUID IDs - Updated the test helper to return UUIDs for GlobalID and WellID in legacy model tests - Changed well_id to use a UUID so it matches the model mapping.
There was a problem hiding this comment.
Pull request overview
This PR adds a read-only admin interface for legacy NMA water levels continuous pressure daily data and updates the underlying model to use UUID-based identifiers instead of strings.
Changes:
- Updated
NMA_WaterLevelsContinuous_Pressure_Dailymodel to use UUID types forGlobalIDandWellIDfields - Added a new read-only Starlette Admin view (
WaterLevelsContinuousPressureDailyAdmin) with comprehensive list and detail field configurations - Updated corresponding test fixtures to generate and use UUID values
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| db/nma_legacy.py | Changed global_id and well_id from String to UUID type mappings |
| admin/views/waterlevelscontinuous_pressure_daily.py | Created new read-only admin view with field configurations and display labels |
| admin/views/init.py | Exported the new admin view class |
| admin/config.py | Registered the new admin view with the NMA model |
| tests/test_waterlevelscontinuous_pressure_daily_legacy.py | Updated test helper and test data to use UUID instead of string |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
db/nma_legacy.py:232
- The well_id field was removed from NMA_HydraulicsData but appears to be orphaned code. If this removal was intentional as part of cleanup, ensure this deletion aligns with the model's current schema and usage.
well_id: Mapped[Optional[uuid.UUID]] = mapped_column("WellID", UUID(as_uuid=True))
…constraint in nma_legacy model
…ntinuous pressure daily records
- Added migrations for thing_id FK and UUID column alignment - Updated pressure daily legacy tests for Thing linkage and FK enforcement
- Cache Thing IDs and map PointID to thing_id to satisfy new FK - Filter orphan rows to prevent invalid inserts - Add focused transfer unit test to validate mapping and filtering
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/test_waterlevelscontinuous_pressure_daily_legacy.py:2
- The copyright year is set to 2026, which is in the future. Update this to the current year or the actual year when this code was written.
# Copyright 2026 ross
…elsContinuous_Pressure_Daily
|
I merged these changes directly into my PR #450 and linearized the alembic migrations. |
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?