projects
/
zzz-floof.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git@veekun.com:floof
[zzz-floof.git]
/
floof
/
model
/
meta.py
diff --git
a/floof/model/meta.py
b/floof/model/meta.py
index
7992ce1
..
1a20aa7
100644
(file)
--- a/
floof/model/meta.py
+++ b/
floof/model/meta.py
@@
-1,11
+1,15
@@
-"""SQLAlchemy Metadata object"""
+"""SQLAlchemy Metadata
and Session
object"""
from sqlalchemy import MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
-__all__ = ['engine', 'metadata']
+__all__ = ['
Session', '
engine', 'metadata']
# SQLAlchemy database engine. Updated by model.init_model()
engine = None
# SQLAlchemy database engine. Updated by model.init_model()
engine = None
-metadata = MetaData()
+# SQLAlchemy session manager. Updated by model.init_model()
+Session = scoped_session(sessionmaker())
+# Global metadata. If you have multiple databases with overlapping table
+# names, you'll need a metadata for each database
+metadata = MetaData()