提交 68a52287 编写于 作者: B Bastian Blank 提交者: Joerg Jaspert

Init declarative sqlalchemy base

上级 7e4f3f5a
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
################################################################################
from sqlalchemy import Column, DateTime
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
......@@ -77,6 +77,8 @@ warnings.filterwarnings('ignore',
"Predicate of partial index .* ignored during reflection",
SAWarning)
from .database.base import Base
################################################################################
......@@ -2570,7 +2572,7 @@ class DBConn(object):
try:
self.db_pg = create_engine(connstr, **engine_args)
self.db_meta = MetaData()
self.db_meta = Base.metadata
self.db_meta.bind = self.db_pg
self.db_smaker = sessionmaker(bind=self.db_pg,
autoflush=True,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册