diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-06 01:19:47 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-06 18:23:11 -0500 |
commit | 1e278de4cc9a4181e0747640a960e80efcea1ca9 (patch) | |
tree | 13d0c035807613bfa07e734acad79b9c843cb8b0 /lib/sqlalchemy/ext/declarative/api.py | |
parent | 1e1a38e7801f410f244e4bbb44ec795ae152e04e (diff) | |
download | sqlalchemy-1e278de4cc9a4181e0747640a960e80efcea1ca9.tar.gz |
Post black reformatting
Applied on top of a pure run of black -l 79 in
I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes
resolves all remaining flake8 conditions for those codes
we have enabled in setup.cfg.
Included are resolutions for all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.
Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
Diffstat (limited to 'lib/sqlalchemy/ext/declarative/api.py')
-rw-r--r-- | lib/sqlalchemy/ext/declarative/api.py | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/lib/sqlalchemy/ext/declarative/api.py b/lib/sqlalchemy/ext/declarative/api.py index 987e92119..a4cbf3b52 100644 --- a/lib/sqlalchemy/ext/declarative/api.py +++ b/lib/sqlalchemy/ext/declarative/api.py @@ -7,30 +7,29 @@ """Public API functions and helpers for declarative.""" -from ...schema import Table, MetaData, Column -from ...orm import ( - synonym as _orm_synonym, - comparable_property, - interfaces, - properties, - attributes, -) -from ...orm.util import polymorphic_union -from ...orm.base import _mapper_or_none -from ...util import OrderedDict, hybridmethod, hybridproperty -from ... import util -from ... import exc -import weakref import re +import weakref -from .base import ( - _as_declarative, - _declarative_constructor, - _DeferredMapperConfig, - _add_attribute, - _del_attribute, -) +from .base import _add_attribute +from .base import _as_declarative +from .base import _declarative_constructor +from .base import _DeferredMapperConfig +from .base import _del_attribute from .clsregistry import _class_resolver +from ... import exc +from ... import util +from ...orm import attributes +from ...orm import comparable_property +from ...orm import interfaces +from ...orm import properties +from ...orm import synonym as _orm_synonym +from ...orm.base import _mapper_or_none +from ...orm.util import polymorphic_union +from ...schema import MetaData +from ...schema import Table +from ...util import hybridmethod +from ...util import hybridproperty +from ...util import OrderedDict def instrument_declarative(cls, registry, metadata): @@ -258,7 +257,8 @@ class declared_attr(interfaces._MappedAttribute, property): @declared_attr.cascading def id(cls): if has_inherited_table(cls): - return Column(ForeignKey('myclass.id'), primary_key=True) + return Column( + ForeignKey('myclass.id'), primary_key=True) else: return Column(Integer, primary_key=True) @@ -362,8 +362,9 @@ def declarative_base( compatible callable to use as the meta type of the generated declarative base class. - .. versionchanged:: 1.1 if :paramref:`.declarative_base.cls` is a single class (rather - than a tuple), the constructed base class will inherit its docstring. + .. versionchanged:: 1.1 if :paramref:`.declarative_base.cls` is a + single class (rather than a tuple), the constructed base class will + inherit its docstring. .. seealso:: |