@@ -41,22 +41,56 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
4141
4242 # ========== Basic Configuration ==========
4343
44- name = "Chemistry Sample Info"
45- label = "Chemistry Sample Info"
44+ name = "NMA Chemistry Sample Info"
45+ label = "NMA Chemistry Sample Info"
4646 icon = "fa fa-flask"
4747
4848 # Integer PK
4949 pk_attr = "id"
5050 pk_type = int
5151
52+ def can_create (self , request : Request ) -> bool :
53+ return False
54+
55+ def can_edit (self , request : Request ) -> bool :
56+ return False
57+
58+ def can_delete (self , request : Request ) -> bool :
59+ return False
60+
5261 # ========== List View ==========
5362
54- sortable_fields = [
63+ list_fields = [
5564 "id" ,
5665 "nma_sample_pt_id" ,
57- "nma_object_id " ,
66+ "nma_wclab_id " ,
5867 "nma_sample_point_id" ,
68+ "nma_object_id" ,
69+ "nma_location_id" ,
70+ "thing_id" ,
71+ HasOne ("thing" , identity = "thing" ),
72+ "collection_date" ,
73+ "collection_method" ,
74+ "collected_by" ,
75+ "analyses_agency" ,
76+ "sample_type" ,
77+ "sample_material_not_h2o" ,
78+ "water_type" ,
79+ "study_sample" ,
80+ "data_source" ,
81+ "data_quality" ,
82+ "public_release" ,
83+ "added_day_to_date" ,
84+ "added_month_day_to_date" ,
85+ "sample_notes" ,
86+ ]
87+
88+ sortable_fields = [
89+ "id" ,
90+ "nma_sample_pt_id" ,
5991 "nma_wclab_id" ,
92+ "nma_sample_point_id" ,
93+ "nma_object_id" ,
6094 "collection_date" ,
6195 "sample_type" ,
6296 "data_source" ,
@@ -67,20 +101,20 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
67101 fields_default_sort = [("collection_date" , True )]
68102
69103 searchable_fields = [
70- "nma_sample_point_id" ,
71104 "nma_sample_pt_id" ,
72105 "nma_wclab_id" ,
106+ "nma_sample_point_id" ,
107+ "collection_date" ,
73108 "collected_by" ,
74109 "analyses_agency" ,
75- "sample_notes" ,
76- "collection_date" ,
77110 "sample_type" ,
78111 "sample_material_not_h2o" ,
79112 "water_type" ,
80113 "study_sample" ,
81114 "data_source" ,
82115 "data_quality" ,
83116 "public_release" ,
117+ "sample_notes" ,
84118 ]
85119
86120 page_size = 50
@@ -91,11 +125,12 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
91125 fields = [
92126 "id" ,
93127 "nma_sample_pt_id" ,
128+ "nma_wclab_id" ,
94129 "nma_sample_point_id" ,
95130 "nma_object_id" ,
96- "nma_wclab_id" ,
97131 "nma_location_id" ,
98132 "thing_id" ,
133+ HasOne ("thing" , identity = "thing" ),
99134 "collection_date" ,
100135 "collection_method" ,
101136 "collected_by" ,
@@ -112,30 +147,20 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
112147 "sample_notes" ,
113148 ]
114149
115- exclude_fields_from_create = [
116- "id" ,
117- "nma_object_id" ,
118- ]
119-
120- exclude_fields_from_edit = [
121- "id" ,
122- "nma_object_id" ,
123- ]
124-
125150 field_labels = {
126151 "id" : "ID" ,
127152 "nma_sample_pt_id" : "NMA SamplePtID (Legacy)" ,
153+ "nma_wclab_id" : "NMA WCLab_ID (Legacy)" ,
128154 "nma_sample_point_id" : "NMA SamplePointID (Legacy)" ,
129155 "nma_object_id" : "NMA OBJECTID (Legacy)" ,
130- "nma_wclab_id" : "NMA WCLab_ID (Legacy)" ,
131156 "nma_location_id" : "NMA LocationId (Legacy)" ,
132157 "thing_id" : "Thing ID" ,
133158 "collection_date" : "Collection Date" ,
134159 "collection_method" : "Collection Method" ,
135160 "collected_by" : "Collected By" ,
136161 "analyses_agency" : "Analyses Agency" ,
137162 "sample_type" : "Sample Type" ,
138- "sample_material_not_h2o" : "Sample Material ( Not H2O) " ,
163+ "sample_material_not_h2o" : "Sample Material Not H2O" ,
139164 "water_type" : "Water Type" ,
140165 "study_sample" : "Study Sample" ,
141166 "data_source" : "Data Source" ,
0 commit comments