summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-01-28 14:56:17 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-01-28 16:29:05 -0500
commit4cae82d51f80c8a7e1a23b26c74b07e01059b804 (patch)
treed5c4e3b683611e9ecdda2e120aab2ea304edc67d /lib/sqlalchemy/orm/base.py
parent586df197615d91af56aefc0d5ff94ceac13154eb (diff)
downloadsqlalchemy-4cae82d51f80c8a7e1a23b26c74b07e01059b804.tar.gz
Place DDLConstraintColumn Role in Mapped
Fixed typing issue where :func:`_orm.mapped_column` objects typed as :class:`_orm.Mapped` wouldn't be accepted in schema constraints such as :class:`_schema.ForeignKey`, :class:`_schema.UniqueConstraint` or :class:`_schema.Index`. Fixes: #9170 Change-Id: I41c76d224a1fa2377de151d2a713ba3f43bd245c
Diffstat (limited to 'lib/sqlalchemy/orm/base.py')
-rw-r--r--lib/sqlalchemy/orm/base.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py
index 331464cf8..5b6675365 100644
--- a/lib/sqlalchemy/orm/base.py
+++ b/lib/sqlalchemy/orm/base.py
@@ -31,6 +31,7 @@ from ._typing import insp_is_mapper
from .. import exc as sa_exc
from .. import inspection
from .. import util
+from ..sql import roles
from ..sql.elements import SQLColumnExpression
from ..sql.elements import SQLCoreOperations
from ..util import FastIntFlag
@@ -775,6 +776,7 @@ class Mapped(
SQLORMExpression[_T],
ORMDescriptor[_T],
_MappedAnnotationBase[_T],
+ roles.DDLConstraintColumnRole,
):
"""Represent an ORM mapped attribute on a mapped class.