root/AuthKit/trunk/examples/user/database-model/model.py

Revision 152 (checked in by thejimmyg, 8 months ago)

Added a series of updates to SQLAlchemy code plus a fix to the OpenID support and an encoding problem with form.py

Line 
1 import sqlalchemy as sa
2 import datetime
3 from sqlalchemy import orm
4 from sqlalchemy import schema, types
5 import sqlalchemy
6 import meta
7
8 def init_model(engine):
9     """Call me before using any of the tables or classes in the model."""
10
11     sm = orm.sessionmaker(autoflush=True, transactional=True, bind=engine)
12
13     meta.engine = engine
14     meta.Session = orm.scoped_session(sm)
15
16
Note: See TracBrowser for help on using the browser.