mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Initial commit
This commit is contained in:
commit
edb3d8f57b
55 changed files with 15544 additions and 0 deletions
18
wowfunding/orm/connect.py
Normal file
18
wowfunding/orm/connect.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from datetime import datetime
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker, relationship
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
import settings
|
||||
|
||||
|
||||
def create_session():
|
||||
from wowfunding.orm.orm import base
|
||||
engine = sa.create_engine(settings.SQLALCHEMY_DATABASE_URI, echo=False, encoding="latin")
|
||||
session = scoped_session(sessionmaker(autocommit=False,
|
||||
autoflush=False,
|
||||
bind=engine))
|
||||
base.query = session.query_property()
|
||||
base.metadata.create_all(bind=engine)
|
||||
return session
|
Loading…
Add table
Add a link
Reference in a new issue