- create a new package
foowithinstao - create a new module
entities.pywithinstao/foo - create new STAO classes for each ST entity
- create a new function in
main.pythat imports, instantiates andrendersthe necessary STAOs
def nmbgmr_locations(request):
from nmbgmr.entities import NMBGMRLocations
stao = NMBGMRLocations()
return stao.render(request)- Create an
ObservationsSTAO. Must be aSTAOsubclass and also inheritObservationMixin
class ISCSevenRiversWaterLevels(BQSTAO, ObservationMixin):- Class must define the following attributes
- _tablename ---
'isc_water_levels' - _fields ---
['dry', 'invalid', 'comments', 'monitoring_point_id', 'dateTime', 'depthToWaterFeet', '_airbyte_ab_id'] - _dataset ---
'levels' - _timestamp_field ---
'dateTime' - _value_field ---
'depthToWaterFeet' - _cursor_id ---
'_airbyte_ab_id' - _location_field ---
'monitoring_point_id' - _agency ---
'ISC_SEVEN_RIVERS' - _thing_name ---
'Water Well' - _datastream_name ---
'Groundwater Levels'
- _tablename ---
- The following attributes are optionals
- _limit ---
500 - _orderby ---
'_airbyte_ab_id asc' - _where ---
'parameterId=4'
- _limit ---
- Create a new function in
main.pyand render the STAO normally.def isc_seven_rivers_water_levels(request): from isc_seven_rivers.entities import ISCSevenRiversWaterLevels stao = ISCSevenRiversWaterLevels() return stao.render(request)