- 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
|
@ -20,7 +20,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, Person, PersonSchema, Observation,
|
||||
create_pg_session, Dataset, Procedure, Phenomenon, Platform)
|
||||
from gschliefgraben_glasfaser.my_api import MyApi
|
||||
|
@ -206,7 +206,7 @@ def create_observation(observation_json: ObservationSchema, db_session,
|
|||
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
|
||||
|
@ -223,7 +223,7 @@ def create_observation(observation_json: ObservationSchema, db_session,
|
|||
return max_id
|
||||
# Otherwise, nope, person exists already
|
||||
else:
|
||||
print(409, f'Observation {ob_id} exists already')
|
||||
# print(409, f'Observation {ob_id} exists already')
|
||||
return max_id
|
||||
|
||||
|
||||
|
@ -269,6 +269,6 @@ def create(person_json: PersonSchema):
|
|||
|
||||
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