- additional module for Gschliefghraben

This commit is contained in:
Arno Kaimbacher 2022-02-21 16:07:04 +01:00
parent 54b210c07d
commit c62eb2cdb0
8 changed files with 243 additions and 1 deletions

View file

@ -0,0 +1,2 @@
# For relative imports to work in Python 3.6
import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__)))

View file

@ -0,0 +1,12 @@
# import os
# #import connexion
# from sqlalchemy.ext import
# from marshmallow import Marshmallow
# Create the SQLAlchemy db instance
# db = SQLAlchemy(app)
# Initialize Marshmallow
# ma = Marshmallow(app)

View file

@ -0,0 +1,15 @@
'''
Tutorial link: https://realpython.com/flask-connexion-rest-api-part-2/
Sqlalchemy version: 1.2.15
Python version: 3.7
'''
import os
# response = requests.get('https://api.com/')
# print(response) # shows the response's HTTP status code
# print(response.json()) # shows the response's JSON response body, if it has one
# print(response.content) # get the data content of the response
# (for your case this is the downloaded file)
# print(dir(response)) # shows you all the different methods you can call on this response object
db_user = os.environ.get("POSTGIS_DBUSER")
print(db_user)

View file

@ -0,0 +1,37 @@
'''
Tutorial link: https://docs.sqlalchemy.org/en/latest/orm/tutorial.html
Sqlalchemy version: 1.2.15
Python version: 3.7
'''
from datetime import datetime
# from config import db, ma
# import os
from sqlalchemy import (Column, Integer,
String, DateTime)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import session
from marshmallow import Schema
from db.pg_models import create_pg_session
Base = declarative_base()
class Person(Base):
""" Platform class """
__tablename__ = 'person'
person_id = Column(Integer, primary_key=True)
lname = Column(String(32), index=True)
fname = Column(String(32))
timestamp = Column(DateTime, default=datetime.utcnow,
onupdate=datetime.utcnow)
class PersonSchema(Schema):
""" Platform class """
class Meta:
""" Platform class """
model = Person
#pg_session: session = create_pg_session()
sqla_session: session = create_pg_session()