- additional module for Gschliefghraben
This commit is contained in:
parent
54b210c07d
commit
c62eb2cdb0
8 changed files with 243 additions and 1 deletions
37
gschliefgraben_glasfaser/models.py
Normal file
37
gschliefgraben_glasfaser/models.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue