SHARE
TWEET

Untitled

a guest Jan 24th, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from settings import *
  2. from sqlalchemy import *
  3. from sqlalchemy.orm import *
  4. from sqlalchemy.ext.declarative import declarative_base
  5.  
  6. engine = create_engine(db_address)
  7. Base = declarative_base(engine)
  8.  
  9.  
  10. class User(Base):
  11.     __tablename__ = "users"
  12.     id = Column(Integer, primary_key=True)
  13.     first_name = Column(String)
  14.     last_name = Column(String)
  15.     extroversion = Column(Integer, default=0)
  16.     neurotism = Column(Integer, default=0)
  17.     lie = Column(Integer, default=0)
  18.     stage = Column(Integer, default=0)
  19.     stage_transferred = Column(Boolean, default=False)
  20.     results = Column(String, default="")
  21.     need_renew = Column(Boolean, default=False)
  22.  
  23.  
  24. temp = sessionmaker(engine)
  25. session = temp()
  26. Base.metadata.create_all(engine)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top