summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/properties.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-12-20 22:05:36 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-01-23 18:10:06 -0500
commit4c2c2c40fde17c85013e00a6f3303a99e2b32c12 (patch)
tree324a2c22eb61cb913e3e162e163f7baff14152cf /lib/sqlalchemy/orm/properties.py
parent5832f7172907a8151345d95061f93784ce4bb9b1 (diff)
downloadsqlalchemy-4c2c2c40fde17c85013e00a6f3303a99e2b32c12.tar.gz
Add deprecation warnings to all deprecated APIs
A large change throughout the library has ensured that all objects, parameters, and behaviors which have been noted as deprecated or legacy now emit ``DeprecationWarning`` warnings when invoked. As the Python 3 interpreter now defaults to displaying deprecation warnings, as well as that modern test suites based on tools like tox and pytest tend to display deprecation warnings, this change should make it easier to note what API features are obsolete. See the notes added to the changelog and migration notes for further details. Fixes: #4393 Change-Id: If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b
Diffstat (limited to 'lib/sqlalchemy/orm/properties.py')
-rw-r--r--lib/sqlalchemy/orm/properties.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index 328c9b1b4..530eadb6b 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -55,6 +55,15 @@ class ColumnProperty(StrategizedProperty):
"_deferred_column_loader",
)
+ @util.deprecated_params(
+ extension=(
+ "0.7",
+ ":class:`.AttributeExtension` is deprecated in favor of the "
+ ":class:`.AttributeEvents` listener interface. The "
+ ":paramref:`.column_property.extension` parameter will be "
+ "removed in a future release.",
+ )
+ )
def __init__(self, *columns, **kwargs):
r"""Provide a column-level property for use with a Mapper.
@@ -120,13 +129,6 @@ class ColumnProperty(StrategizedProperty):
which will be prepended to the list of attribute listeners for the
resulting descriptor placed on the class.
- .. deprecated:: 0.7
-
- :class:`.AttributeExtension` is deprecated in favor of the
- :class:`.AttributeEvents` listener interface. The
- :paramref:`.column_property.extension` parameter will be
- removed in a future release.
-
"""
super(ColumnProperty, self).__init__()
self._orig_columns = [expression._labeled(c) for c in columns]