Mike Bayer  committed fdd5c13

pep8 stuff

  • Participants
  • Parent commits f1f5851

Comments (0)

Files changed (1)

File lib/sqlalchemy/ext/

 from import RelationshipProperty, ColumnProperty, CompositeProperty
 from ..orm.util import _is_mapped_class
 from .. import util, exc
-from ..sql import util as sql_util, expression
+from ..sql import expression
 from .. import event
 from ..orm.util import polymorphic_union, _mapper_or_none
 import weakref
     mapped table, otherwise return False.
     for class_ in cls.__mro__:
-        if getattr(class_,'__table__',None) is not None:
+        if getattr(class_, '__table__', None) is not None:
             return True
     return False
         if class_mapped:
             parent_columns = base.__table__.c.keys()
-        for name,obj in vars(base).items():
+        for name, obj in vars(base).items():
             if name == '__mapper_args__':
                 if not mapper_args_fn and (
                                         not class_mapped or
             # in multi-column ColumnProperties.
             if key == c.key:
                 del our_stuff[key]
-    declared_columns = sorted(declared_columns, key=lambda c:c._creation_order)
+    declared_columns = sorted(declared_columns, key=lambda c: c._creation_order)
     table = None
     if hasattr(cls, '__table_cls__'):
         self.configs[cls] = self
     def _prepare_mapper_arguments(self):
-        cls = self.cls
-        table = self.local_table
         properties =
         if self.mapper_args_fn:
             mapper_args = self.mapper_args_fn()
         for k in ('version_id_col', 'polymorphic_on',):
             if k in mapper_args:
                 v = mapper_args[k]
-                mapper_args[k] = self.column_copies.get(v,v)
+                mapper_args[k] = self.column_copies.get(v, v)
         assert 'inherits' not in mapper_args, \
             "Can't specify 'inherits' explicitly with declarative mappings"
         from sqlalchemy.orm import foreign, remote
         fallback = sqlalchemy.__dict__.copy()
-        fallback.update({'foreign':foreign, 'remote':remote})
+        fallback.update({'foreign': foreign, 'remote': remote})
         def access_cls(key):
             if key in cls._decl_class_registry:
             key, kwargs = prop.backref
             for attr in ('primaryjoin', 'secondaryjoin', 'secondary',
                          'foreign_keys', 'remote_side', 'order_by'):
-               if attr in kwargs and isinstance(kwargs[attr], basestring):
-                   kwargs[attr] = resolve_arg(kwargs[attr])
+                if attr in kwargs and isinstance(kwargs[attr], basestring):
+                    kwargs[attr] = resolve_arg(kwargs[attr])
     return prop
         mappers = list(m.self_and_descendants)
         pjoin = cls._create_polymorphic_union(mappers)
-        m._set_with_polymorphic(("*",pjoin))
+        m._set_with_polymorphic(("*", pjoin))
 class AbstractConcreteBase(ConcreteBase):