]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Deprecate strings indicating attribute names
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Oct 2020 19:17:25 +0000 (15:17 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Oct 2020 18:43:38 +0000 (14:43 -0400)
commit348260943a52ddd7ee3388eaac8e05da3794958b
tree6acc17d97e8f1b11f29ffbd86386155cb5e80c1a
parenta3e2eb7c3c3fe6b2bebd14a7e9d661b2b4519d1f
Deprecate strings indicating attribute names

Using strings to represent relationship names in ORM operations such as
:meth:`_orm.Query.join`, as well as strings for all ORM attribute names
in loader options like :func:`_orm.selectinload`
is deprecated and will be removed in SQLAlchemy 2.0.  The class-bound
attribute should be passed instead.  This provides much better specificity
to the given method, allows for modifiers such as ``of_type()``, and
reduces internal complexity.

Additionally, the ``aliased`` and ``from_joinpoint`` parameters to
:meth:`_orm.Query.join` are also deprecated.   The :func:`_orm.aliased`
construct now provides for a great deal of flexibility and capability
and should be used directly.

Fixes: #4705
Fixes: #5202
Change-Id: I32f61663d68026154906932913c288f269991adc
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_14/4705.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategy_options.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/testing/warnings.py
test/orm/test_deprecations.py
test/orm/test_joins.py
test/orm/test_query.py