|
| 1 | +# =============================================================================== |
| 2 | +# Copyright 2026 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# =============================================================================== |
| 16 | +""" |
| 17 | +WaterLevelsContinuousPressureDailyAdmin view for legacy NMA_WaterLevelsContinuous_Pressure_Daily. |
| 18 | +""" |
| 19 | + |
| 20 | +from starlette.requests import Request |
| 21 | + |
| 22 | +from admin.views.base import OcotilloModelView |
| 23 | + |
| 24 | + |
| 25 | +class WaterLevelsContinuousPressureDailyAdmin(OcotilloModelView): |
| 26 | + """ |
| 27 | + Admin view for NMA_WaterLevelsContinuous_Pressure_Daily model. |
| 28 | + """ |
| 29 | + |
| 30 | + # ========== Basic Configuration ========== |
| 31 | + name = "NMA Water Levels Continuous Pressure Daily" |
| 32 | + label = "NMA Water Levels Continuous Pressure Daily" |
| 33 | + icon = "fa fa-tachometer-alt" |
| 34 | + |
| 35 | + def can_create(self, request: Request) -> bool: |
| 36 | + return False |
| 37 | + |
| 38 | + def can_edit(self, request: Request) -> bool: |
| 39 | + return False |
| 40 | + |
| 41 | + def can_delete(self, request: Request) -> bool: |
| 42 | + return False |
| 43 | + |
| 44 | + # ========== List View ========== |
| 45 | + list_fields = [ |
| 46 | + "global_id", |
| 47 | + "object_id", |
| 48 | + "well_id", |
| 49 | + "point_id", |
| 50 | + "date_measured", |
| 51 | + "temperature_water", |
| 52 | + "water_head", |
| 53 | + "water_head_adjusted", |
| 54 | + "depth_to_water_bgs", |
| 55 | + "measurement_method", |
| 56 | + "data_source", |
| 57 | + "measuring_agency", |
| 58 | + "qced", |
| 59 | + "notes", |
| 60 | + "created", |
| 61 | + "updated", |
| 62 | + "processed_by", |
| 63 | + "checked_by", |
| 64 | + "cond_dl_ms_cm", |
| 65 | + ] |
| 66 | + |
| 67 | + sortable_fields = [ |
| 68 | + "global_id", |
| 69 | + "object_id", |
| 70 | + "well_id", |
| 71 | + "point_id", |
| 72 | + "date_measured", |
| 73 | + "water_head", |
| 74 | + "depth_to_water_bgs", |
| 75 | + "measurement_method", |
| 76 | + "data_source", |
| 77 | + "measuring_agency", |
| 78 | + "qced", |
| 79 | + "created", |
| 80 | + "updated", |
| 81 | + "processed_by", |
| 82 | + "checked_by", |
| 83 | + "cond_dl_ms_cm", |
| 84 | + ] |
| 85 | + |
| 86 | + fields_default_sort = [("date_measured", True)] |
| 87 | + |
| 88 | + searchable_fields = [ |
| 89 | + "global_id", |
| 90 | + "well_id", |
| 91 | + "point_id", |
| 92 | + "date_measured", |
| 93 | + "measurement_method", |
| 94 | + "data_source", |
| 95 | + "measuring_agency", |
| 96 | + "notes", |
| 97 | + ] |
| 98 | + |
| 99 | + page_size = 50 |
| 100 | + page_size_options = [25, 50, 100, 200] |
| 101 | + |
| 102 | + # ========== Detail View ========== |
| 103 | + fields = [ |
| 104 | + "global_id", |
| 105 | + "object_id", |
| 106 | + "well_id", |
| 107 | + "point_id", |
| 108 | + "date_measured", |
| 109 | + "temperature_water", |
| 110 | + "water_head", |
| 111 | + "water_head_adjusted", |
| 112 | + "depth_to_water_bgs", |
| 113 | + "measurement_method", |
| 114 | + "data_source", |
| 115 | + "measuring_agency", |
| 116 | + "qced", |
| 117 | + "notes", |
| 118 | + "created", |
| 119 | + "updated", |
| 120 | + "processed_by", |
| 121 | + "checked_by", |
| 122 | + "cond_dl_ms_cm", |
| 123 | + ] |
| 124 | + |
| 125 | + field_labels = { |
| 126 | + "global_id": "GlobalID", |
| 127 | + "object_id": "OBJECTID", |
| 128 | + "well_id": "WellID", |
| 129 | + "point_id": "PointID", |
| 130 | + "date_measured": "Date Measured", |
| 131 | + "temperature_water": "Temperature Water", |
| 132 | + "water_head": "Water Head", |
| 133 | + "water_head_adjusted": "Water Head Adjusted", |
| 134 | + "depth_to_water_bgs": "Depth To Water (BGS)", |
| 135 | + "measurement_method": "Measurement Method", |
| 136 | + "data_source": "Data Source", |
| 137 | + "measuring_agency": "Measuring Agency", |
| 138 | + "qced": "QCed", |
| 139 | + "notes": "Notes", |
| 140 | + "created": "Created", |
| 141 | + "updated": "Updated", |
| 142 | + "processed_by": "Processed By", |
| 143 | + "checked_by": "Checked By", |
| 144 | + "cond_dl_ms_cm": "CONDDL (mS/cm)", |
| 145 | + } |
| 146 | + |
| 147 | + |
| 148 | +# ============= EOF ============================================= |
0 commit comments