summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/engine/default.py2
-rw-r--r--lib/sqlalchemy/ext/activemapper.py1
-rw-r--r--lib/sqlalchemy/orm/__init__.py8
-rw-r--r--lib/sqlalchemy/orm/attributes.py4
-rw-r--r--lib/sqlalchemy/sql/__init__.py1
-rw-r--r--lib/sqlalchemy/sql/expression.py9
-rw-r--r--lib/sqlalchemy/sql/operators.py9
7 files changed, 19 insertions, 15 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 9732b9e59..f4565c938 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -7,8 +7,8 @@
"""Default implementations of per-dialect sqlalchemy.engine classes."""
-from sqlalchemy import schema, exceptions, util
import re, random
+from sqlalchemy import util
from sqlalchemy.engine import base
from sqlalchemy.sql import compiler, expression
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py
index 8f2ced73f..5f9aba956 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -4,7 +4,6 @@ from sqlalchemy.orm import class_mapper, relation, scoped_session
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import backref as create_backref
-import sqlalchemy
import inspect
import sys
diff --git a/lib/sqlalchemy/orm/__init__.py b/lib/sqlalchemy/orm/__init__.py
index 5a2c41449..222bd75fb 100644
--- a/lib/sqlalchemy/orm/__init__.py
+++ b/lib/sqlalchemy/orm/__init__.py
@@ -10,28 +10,30 @@ the schema and sql packages and tying operations to class properties and
constructors.
"""
-from sqlalchemy import exceptions
from sqlalchemy import util as sautil
from sqlalchemy.orm.mapper import Mapper, object_mapper, class_mapper, mapper_registry
from sqlalchemy.orm.interfaces import SynonymProperty, MapperExtension, EXT_CONTINUE, EXT_STOP, EXT_PASS, ExtensionOption, PropComparator
from sqlalchemy.orm.properties import PropertyLoader, ColumnProperty, CompositeProperty, BackRef
from sqlalchemy.orm import mapper as mapperlib
-from sqlalchemy.orm import collections, strategies
+from sqlalchemy.orm import strategies
from sqlalchemy.orm.query import Query
from sqlalchemy.orm.util import polymorphic_union
from sqlalchemy.orm.session import Session as _Session
from sqlalchemy.orm.session import object_session, attribute_manager, sessionmaker
from sqlalchemy.orm.scoping import ScopedSession
+
__all__ = [ 'relation', 'column_property', 'composite', 'backref', 'eagerload',
'eagerload_all', 'lazyload', 'noload', 'deferred', 'defer',
'undefer', 'undefer_group', 'extension', 'mapper', 'clear_mappers',
'compile_mappers', 'class_mapper', 'object_mapper', 'sessionmaker',
- 'scoped_session', 'dynamic_loader', 'MapperExtension', 'polymorphic_union',
+ 'scoped_session', 'dynamic_loader', 'MapperExtension',
+ 'polymorphic_union',
'create_session', 'synonym', 'contains_alias', 'Query',
'contains_eager', 'EXT_CONTINUE', 'EXT_STOP', 'EXT_PASS',
'object_session', 'PropComparator' ]
+
def scoped_session(session_factory, scopefunc=None):
"""Provides thread-local management of Sessions.
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 511e4a326..714b00376 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -7,9 +7,9 @@
import weakref, threading
import UserDict
from sqlalchemy import util
-from sqlalchemy.orm import util as orm_util, interfaces, collections
+from sqlalchemy.orm import interfaces, collections
from sqlalchemy.orm.mapper import class_mapper
-from sqlalchemy import logging, exceptions
+from sqlalchemy import exceptions
PASSIVE_NORESULT = object()
diff --git a/lib/sqlalchemy/sql/__init__.py b/lib/sqlalchemy/sql/__init__.py
index 06b9f1f75..c966f396a 100644
--- a/lib/sqlalchemy/sql/__init__.py
+++ b/lib/sqlalchemy/sql/__init__.py
@@ -1,3 +1,2 @@
from sqlalchemy.sql.expression import *
from sqlalchemy.sql.visitors import ClauseVisitor, NoColumnVisitor
-
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index 6f3ee94ab..90c670ce3 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -6,10 +6,9 @@
"""Defines the base components of SQL expression trees.
-
All components are derived from a common base class
-[sqlalchemy.sql.expression#ClauseElement]. Common behaviors are organized based
-on class hierarchies, in some cases via mixins.
+[sqlalchemy.sql.expression#ClauseElement]. Common behaviors are organized
+based on class hierarchies, in some cases via mixins.
All object construction from this package occurs via functions which
in some cases will construct composite ``ClauseElement`` structures
@@ -26,10 +25,11 @@ classes usually have few or no public methods and are less guaranteed
to stay the same in future releases.
"""
+import re
from sqlalchemy import util, exceptions
from sqlalchemy.sql import operators, visitors
from sqlalchemy import types as sqltypes
-import re
+
__all__ = [
'Alias', 'ClauseElement',
@@ -43,6 +43,7 @@ __all__ = [
'literal_column', 'not_', 'null', 'or_', 'outparam', 'outerjoin', 'select',
'subquery', 'table', 'text', 'union', 'union_all', 'update', ]
+
BIND_PARAMS = re.compile(r'(?<![:\w\x5c]):(\w+)(?!:)', re.UNICODE)
def desc(column):
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index c1d2ebc87..cf8aeb71d 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -1,6 +1,10 @@
-"""define opeators used in SQL expressions"""
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
-from operator import and_, or_, inv, add, mul, sub, div, mod, truediv, lt, le, ne, gt, ge, eq
+"""Defines operators used in SQL expressions."""
+
+from operator import and_, or_, inv, add, mul, sub, div, mod, truediv, \
+ lt, le, ne, gt, ge, eq
def from_():
raise NotImplementedError()
@@ -58,4 +62,3 @@ def desc_op(a):
def asc_op(a):
return a.asc()
-