From 3c43cfc9f91b487d52ff7868f821fe920f676d90 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 22 Jan 2012 20:17:43 +0100 Subject: Move declarative_base Base into base.py The base class of all models "Base" should be in base.py. --- mediagoblin/db/sql/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mediagoblin/db/sql/base.py') diff --git a/mediagoblin/db/sql/base.py b/mediagoblin/db/sql/base.py index 6f45b21b..1db53c56 100644 --- a/mediagoblin/db/sql/base.py +++ b/mediagoblin/db/sql/base.py @@ -15,6 +15,7 @@ # along with this program. If not, see . +from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker, object_session from sqlalchemy.orm.query import Query from sqlalchemy.sql.expression import desc @@ -73,3 +74,6 @@ class GMGTableBase(object): sess = Session() sess.add(self) sess.commit() + + +Base = declarative_base(cls=GMGTableBase) -- cgit v1.2.3