Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

orm now works.

  • Loading branch information...
commit 901c37054604bfe9a084041d26645268e7b2bbca 1 parent 436cbf7
@alswl authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 config.py
View
23 config.py
@@ -0,0 +1,23 @@
+# coding=utf8
+
+import logging
+import logging.config
+import yaml
+
+from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import scoped_session, sessionmaker
+from sqlalchemy import create_engine
+
+config = yaml.load(open('config.yml', 'r'))
+
+engine = create_engine(config['data'], echo=True) # set data connect string
+
+# SQLAlchemy session manager. Updated by model.init_model()
+Session = scoped_session(sessionmaker())
+Session.configure(bind=engine)
+session = Session()
+
+# The declarative Base
+Base = declarative_base()
+
+logging.config.dictConfig(config['logging'])
Please sign in to comment.
Something went wrong with that request. Please try again.