-
Notifications
You must be signed in to change notification settings - Fork 4
BDMS-453 #349
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
Closed
Closed
BDMS-453 #349
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # =============================================================================== | ||
| # Copyright 2026 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # =============================================================================== | ||
| """ | ||
| HydraulicsDataAdmin view for legacy NMA_HydraulicsData. | ||
| """ | ||
| from admin.views.base import OcotilloModelView | ||
|
|
||
|
|
||
| class HydraulicsDataAdmin(OcotilloModelView): | ||
| """ | ||
| Admin view for NMAHydraulicsData model. | ||
| """ | ||
|
|
||
| # ========== Basic Configuration ========== | ||
|
|
||
| name = "Hydraulics Data" | ||
| label = "Hydraulics Data" | ||
| icon = "fa fa-tint" | ||
|
|
||
| can_create = False | ||
| can_edit = False | ||
| can_delete = False | ||
|
|
||
| # ========== List View ========== | ||
|
|
||
| column_list = [ | ||
| "global_id", | ||
| "point_id", | ||
| "hydraulic_unit", | ||
| "hydraulic_unit_type", | ||
| "test_top", | ||
| "test_bottom", | ||
| "t_ft2_d", | ||
| "k_darcy", | ||
| "data_source", | ||
| ] | ||
|
|
||
| column_sortable_list = [ | ||
| "global_id", | ||
| "point_id", | ||
| "hydraulic_unit", | ||
| "hydraulic_unit_type", | ||
| "test_top", | ||
| "test_bottom", | ||
| "t_ft2_d", | ||
| "k_darcy", | ||
| "data_source", | ||
| ] | ||
|
|
||
| search_fields = [ | ||
| "global_id", | ||
| "point_id", | ||
| "hydraulic_unit", | ||
| "hydraulic_remarks", | ||
| ] | ||
|
|
||
| column_filters = [ | ||
| "hydraulic_unit", | ||
| "hydraulic_unit_type", | ||
| "data_source", | ||
| ] | ||
|
|
||
| can_export = True | ||
| export_types = ["csv", "excel"] | ||
|
|
||
| page_size = 50 | ||
| page_size_options = [25, 50, 100, 200] | ||
|
|
||
| # ========== Form View ========== | ||
|
|
||
| fields = [ | ||
| "global_id", | ||
| "point_id", | ||
| "hydraulic_unit", | ||
| "hydraulic_unit_type", | ||
| "hydraulic_remarks", | ||
| "test_top", | ||
| "test_bottom", | ||
| "t_ft2_d", | ||
| "s_dimensionless", | ||
| "ss_ft_1", | ||
| "sy_decimalfractn", | ||
| "kh_ft_d", | ||
| "kv_ft_d", | ||
| "hl_day_1", | ||
| "hd_ft2_d", | ||
| "cs_gal_d_ft", | ||
| "p_decimal_fraction", | ||
| "k_darcy", | ||
| "data_source", | ||
| ] | ||
|
|
||
| labels = { | ||
| "global_id": "GlobalID", | ||
| "point_id": "PointID", | ||
| "hydraulic_unit": "HydraulicUnit", | ||
| "hydraulic_unit_type": "HydraulicUnitType", | ||
| "hydraulic_remarks": "Hydraulic Remarks", | ||
| "test_top": "TestTop", | ||
| "test_bottom": "TestBottom", | ||
| "t_ft2_d": "T (ft2/d)", | ||
| "s_dimensionless": "S (dimensionless)", | ||
| "ss_ft_1": "Ss (ft-1)", | ||
| "sy_decimalfractn": "Sy (decimalfractn)", | ||
| "kh_ft_d": "KH (ft/d)", | ||
| "kv_ft_d": "KV (ft/d)", | ||
| "hl_day_1": "HL (day-1)", | ||
| "hd_ft2_d": "HD (ft2/d)", | ||
| "cs_gal_d_ft": "Cs (gal/d/ft)", | ||
| "p_decimal_fraction": "P (decimal fraction)", | ||
| "k_darcy": "k (darcy)", | ||
| "data_source": "Data Source", | ||
| } | ||
|
|
||
|
|
||
| # ============= EOF ============================================= |
55 changes: 55 additions & 0 deletions
55
alembic/versions/d1a2b3c4e5f6_create_nma_hydraulicsdata.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| """Create legacy NMA_HydraulicsData table. | ||
|
|
||
| Revision ID: d1a2b3c4e5f6 | ||
| Revises: c9f1d2e3a4b5 | ||
| Create Date: 2026-02-10 04:00:00.000000 | ||
| """ | ||
|
|
||
| from typing import Sequence, Union | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
| from sqlalchemy import inspect | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "d1a2b3c4e5f6" | ||
| down_revision: Union[str, Sequence[str], None] = "c9f1d2e3a4b5" | ||
| branch_labels: Union[str, Sequence[str], None] = None | ||
| depends_on: Union[str, Sequence[str], None] = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| """Create the legacy hydraulics data table used for backfill.""" | ||
| bind = op.get_bind() | ||
| inspector = inspect(bind) | ||
| if not inspector.has_table("NMA_HydraulicsData"): | ||
| op.create_table( | ||
| "NMA_HydraulicsData", | ||
| sa.Column("GlobalID", sa.String(length=40), primary_key=True), | ||
| sa.Column("PointID", sa.String(length=50), nullable=True), | ||
| sa.Column("HydraulicUnit", sa.String(length=18), nullable=True), | ||
| sa.Column("TestTop", sa.SmallInteger(), nullable=False), | ||
| sa.Column("TestBottom", sa.SmallInteger(), nullable=False), | ||
| sa.Column("HydraulicUnitType", sa.String(length=2), nullable=True), | ||
| sa.Column("Hydraulic Remarks", sa.String(length=200), nullable=True), | ||
| sa.Column("T (ft2/d)", sa.Float(), nullable=True), | ||
| sa.Column("S (dimensionless)", sa.Float(), nullable=True), | ||
| sa.Column("Ss (ft-1)", sa.Float(), nullable=True), | ||
| sa.Column("Sy (decimalfractn)", sa.Float(), nullable=True), | ||
| sa.Column("KH (ft/d)", sa.Float(), nullable=True), | ||
| sa.Column("KV (ft/d)", sa.Float(), nullable=True), | ||
| sa.Column("HL (day-1)", sa.Float(), nullable=True), | ||
| sa.Column("HD (ft2/d)", sa.Float(), nullable=True), | ||
| sa.Column("Cs (gal/d/ft)", sa.Float(), nullable=True), | ||
| sa.Column("P (decimal fraction)", sa.Float(), nullable=True), | ||
| sa.Column("k (darcy)", sa.Float(), nullable=True), | ||
| sa.Column("Data Source", sa.String(length=255), nullable=True), | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| """Drop the legacy hydraulics data table.""" | ||
| bind = op.get_bind() | ||
| inspector = inspect(bind) | ||
| if inspector.has_table("NMA_HydraulicsData"): | ||
| op.drop_table("NMA_HydraulicsData") | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The migration declares
down_revisionasc9f1d2e3a4b5, but there is no corresponding revision file inalembic/versions, so the migration graph is disconnected andalembic upgrade headwill fail to resolve this dependency. This blocks schema upgrades in any environment that runs migrations. Pointdown_revisionat the current head revision (e.g.,5f4e2b0a6b8b) or add the missing revision.Useful? React with 👍 / 👎.