- add image import script for Pechgraben images
This commit is contained in:
parent
dc58b7235f
commit
d33e9d2b55
9 changed files with 503 additions and 112 deletions
|
@ -13,7 +13,7 @@ from dotenv import load_dotenv, find_dotenv
|
|||
from sqlalchemy.orm import session
|
||||
from sqlalchemy import func, asc, desc
|
||||
# from db.pg_models import Platform
|
||||
from gschliefgraben_glasfaser.models import (
|
||||
from db.models import (
|
||||
ObservationSchema, Observation, create_pg_session,
|
||||
Dataset, Procedure, Phenomenon, Platform)
|
||||
from gschliefgraben_glasfaser.my_api import MyApi
|
||||
|
@ -149,7 +149,7 @@ def create_observation(observation_json: ObservationSchema, db_session, max_id,
|
|||
schema = ObservationSchema()
|
||||
# deserialize to python object
|
||||
new_observation: Observation = schema.load(observation_json)
|
||||
new_observation.id = max_id
|
||||
# new_observation.id = max_id
|
||||
new_observation.sta_identifier = str(uuid.uuid4())
|
||||
new_observation.sampling_time_start = new_observation.result_time
|
||||
new_observation.sampling_time_end = new_observation.result_time
|
||||
|
@ -172,6 +172,6 @@ def create_observation(observation_json: ObservationSchema, db_session, max_id,
|
|||
|
||||
if __name__ == "__main__":
|
||||
load_dotenv(find_dotenv())
|
||||
print('sensors: {}'.format(os.environ.get(
|
||||
'GLASFASER_GSCHLIEFGRABEN_SENSORS', [])))
|
||||
sensor_list1 = os.environ.get('GLASFASER_GSCHLIEFGRABEN_SENSORS', [])
|
||||
print(f'sensors: {sensor_list1} .')
|
||||
main()
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue