Changeset 946 for trunk/packages/sipb-xen-database/python/database
- Timestamp:
- Sep 29, 2008, 2:21:34 AM (16 years ago)
- Location:
- trunk/packages/sipb-xen-database/python/database
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-database/python/database/__init__.py
r829 r946 1 1 from invirt.config import structs as config 2 2 from models import * 3 import sqlalchemy 3 4 4 5 def connect(uri = config.db.uri): 5 6 """ Connect to a given database URI""" 6 meta. connect(uri)7 meta.bind = sqlalchemy.create_engine(uri) -
trunk/packages/sipb-xen-database/python/database/models.py
r874 r946 1 1 from sqlalchemy import * 2 from sqlalchemy.orm import create_session, relation 2 3 3 4 from sqlalchemy.ext.sessioncontext import SessionContext … … 24 25 ] 25 26 26 meta = DynamicMetaData()27 meta = ThreadLocalMetaData() 27 28 ctx = SessionContext(create_session) 28 29
Note: See TracChangeset
for help on using the changeset viewer.