test.py
607 Bytes
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
#from iso8583_web.models import Base
from sqlalchemy.ext.declarative import declarative_base
from zope.sqlalchemy import ZopeTransactionExtension
from sqlalchemy.orm import (
sessionmaker,
scoped_session,
)
Base=declarative_base()
DBSession = DBSession = scoped_session(
sessionmaker(extension=ZopeTransactionExtension()))
url = 'postgresql://samsat_banten:2m~k13@localhost:5432/samsat_banten'
engine = create_engine(url)
Base.metadata.bind = engine
Base.metadata.create_all()