Skip to content

Commit

Permalink
minor import cleanup meta.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 26, 2012
1 parent 6a728d6 commit fc58cb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ckan/model/meta.py
@@ -1,10 +1,9 @@
import datetime

from paste.deploy.converters import asbool
from pylons import config
"""SQLAlchemy Metadata and Session object"""
from sqlalchemy import MetaData, and_
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm import scoped_session, sessionmaker
import sqlalchemy.orm as orm
from sqlalchemy.orm.session import SessionExtension

Expand Down Expand Up @@ -81,7 +80,7 @@ def before_commit(self, session):
if not hasattr(obj, '__revision_class__'):
continue
revision_cls = obj.__revision_class__
revision_table = class_mapper(revision_cls).mapped_table
revision_table = orm.class_mapper(revision_cls).mapped_table
## when a normal active transaction happens
if 'pending' not in obj.state:
### this is asql statement as we do not want it in object cache
Expand Down Expand Up @@ -124,7 +123,7 @@ def after_rollback(self, session):
# SQLAlchemy database engine. Updated by model.init_model()
engine = None

Session = scoped_session(sessionmaker(
Session = orm.scoped_session(orm.sessionmaker(
autoflush=False,
autocommit=False,
expire_on_commit=False,
Expand All @@ -134,7 +133,7 @@ def after_rollback(self, session):
ckan.lib.activity.DatasetActivitySessionExtension()],
))

create_local_session = sessionmaker(
create_local_session = orm.sessionmaker(
autoflush=False,
autocommit=False,
expire_on_commit=False,
Expand Down

0 comments on commit fc58cb0

Please sign in to comment.